[postgis-users] POSTGIS DTED...

David Blasby dblasby at refractions.net
Fri May 16 14:58:19 PDT 2003


Nick Ton wrote:

>Hi David,
>
>Thank you for your response about raster capabilities in PostGIS.
>It seems though that the CHIP data structure is for external programs 
>developed using C or C++. Is there an equivalent Java version of the CHIP
>data structure? Also, I am a bit new to the GIS world, so I apologize
>for asking these silly questions:
>
You could convert the binary object into a JAVA object.  Its fairly 
simple, you just have to be very careful about ENDIAN concerns.

>Your email states that we can create a table using the following SQL
>command:
>CREATE TABLE myRaster (mychip chip, mybox geometry);
>a. Can I make this command call in the psql console enviroment once PostGis
>is installed?
>Or do I create a C program that first defines "mychip" data structure and
>then
>execute the SQL CREATE command in the same C program?
>
This "CREATE TABLE" command is pure SQL so you could run it in a  psql 
console once PostGIS is installed.  It just creates a table that can 
store CHIP data.  You'll have to have another program (say C/C++/JAVA) 
that actually creates the CHIP to stick in the table.  You'll also want 
another program (C/C++/JAVA) that takes the data out of the database.  
In terms of the GEOMETRY datatype, you use shp2pgsql to put data into a 
table, and pgsql2shp (or mapserver or JDBC...) to pull data out of the 
database.

The CHIP type is pretty much just a bit bucket right now.

>b. If the latter is true, does this imply that I would have to invoke
>the update and query command from the same C Program. It's not clear to me
>that once I define the "mychip" data structure that any other external
>program
>would know the "mychip" data structure without having to redefine it.
>

Your external program will have to know what the CHIP datastructure 
looks like so it can retreive them from the database and understand what 
its been given.

I hope I'm making myself clear and answering your question.   Here's an 
example of what I mean.  The mess of numbers is the actual chip.

ts_production=# \d hawaii_z4_1
      Table "hawaii_z4_1"
 Column |   Type   | Modifiers
--------+----------+-----------
 mychip | chip     |
 mybox  | geometry |
Indexes: hawaii_z4_gis

ts_production=# select * from hawaii_z4_1 limit 1;
 580800000100000000000000DEAA2241000000802DF041410000000000000000000000005EAD224100000080CDF0414100000000000000000400000000000000CDCCCC3D6A000000200000002000000000000000883A500B0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 
| SRID=-1;BOX3D(611695 2351195 0,612015 2351515 0)





More information about the postgis-users mailing list