LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

ideas about storage of spatial data in Labview?

hello,
by working on a project i have met such a problem:
how can i read the data from the spatial database named PostGIS and in which format can i store the data in Labview?
0 Kudos
Message 1 of 6
(2,962 Views)

> how can i read the data from the spatial database named PostGIS

As far as I can tell, PostGIS is a PostgreSQL database. So you need to
install it, and communicate with the database over an ODBC connection (on
Windows, use LabSQL VI's or NI's SQL database toolkit), or by using the
PostgreSQL commandline (Windows and Linux). The exact commands to send are
described in the documentation.

> and in which format can i store the data in Labview?

Any format you like. You can create your own binary files as well as ASCII
files, so anything you want can be put into a file.

Regards,

Wiebe.


0 Kudos
Message 2 of 6
(2,929 Views)
thanks a lot,
but as my tutor wished, it is the best, when i can store all of the postgis data in labview. in this way we can use the data without the database. So far as you know, is that realisable?
 
thanks a lot again and with regards
 
 
echoseele
0 Kudos
Message 3 of 6
(2,921 Views)
You (obviously) cannot store it in LabVIEW. Your program can store it any
file you like. This depends on what you want to store. Any format is
possible.

Because you get the data from a database, I'd store the data in a local
database. But a file can also work, if the data you need to store is not to
big.

So in short, yes, it is realisable.

Regards,

Wiebe.


0 Kudos
Message 4 of 6
(2,899 Views)

Thanks!

I mean that i want to store the whole data from PostGIS in a File or Database that LabVIEW can easily read the data. Just like TDMS, Datalog File and so on. But i have no idea about the structure of Data in this File/Database because of the structure of the Spatial Database like PostGIS.

The spatial data are stored in PostGIS in the form of "point (10 20)", "line ((10 20), (50 80))" in one column...So it is for me very important, how can i store the data in order to "translate" the string into numbers.

 

thanks a lot and with best regards,

echoes

0 Kudos
Message 5 of 6
(2,885 Views)
So you have a remote database (probably somewhere on the file system)...
This database is a PostgreSQL database.

Now you want this data to be available on your local machine. The most
effective way is to simply copy the database. If you do that, you can use
all code for the local and the remote database. Simply connect to one of
them, and the queries will succeed. MySQL has functions to create copies of
the database, and my guess is PostgreSQL has similar functions. So a command
line call to the database is probably all that is needed to make the copy.

If you (for some reason I can't imagine) want to read all information from
the database and store it in a text file, I can't give you all the details.
I'm not a PostGIS expert. I have no idea what sort of things are stored in
the database or how it is organized. Going by the manual, it sure looks
complicated.

In general, you need to do a query for each table (SELECT * FROM table).

1) do a query
2) store the query's result (it is a 2D array, so convert it to a
spreadsheet string)
3) repeat these steps, until you queried all tables.

If you do this, you have all the information in the database.

Regards,

Wiebe.


0 Kudos
Message 6 of 6
(2,870 Views)