[postgis-users] Newbie questions: SRIDs, function return values

David Jantzen david at culturemob.com
Wed May 14 15:13:04 PDT 2008


Hi All,

I'm brand spanking new to the GIS world, so I've got some pretty dumb
questions.  If the answer is "RTFM" that's fine, please just be specific
about which documentation to look at.

What I'm trying to do: 
1) Properly load the Zillow neighborhood shapefiles into a PostGIS
enabled database.
2) Write some test queries to learn about the dataset and PostGIS
functionality.
3) Take a lat/long and convert it to the appropriate neighborhood.

I've made some progress on #1, but I'm not sure I've done it properly
with respect to the SRID.  I loaded the Washington state data with this
command:

shp2pgsql ZillowNeighborhoods-WA.shp neighborhoods | psql GeoTest -U
postgres

The data loads without error and geometry_columns now contains:
 
f_table_name  | f_geometry_column |coord_dimension | srid |  type     
-----------------+----------------+---------------+-------------------+--
neighborhoods | the_geom          |              2 |   -1 | MULTIPOLYGON

I'm concerned that I have to specify the correct SRID, however I don't
see it anywhere in the Zillow .prj files, so I'm letting it default to
-1 hoping it will be magically correct.  I suspect this may be
problematic.

Next, I'm attempting some basic queries, such as:
select area(the_geom) from neighborhoods where name = 'Ballard';
         area         
----------------------
 0.000461824752619577

select distance((select the_geom from neighborhoods where name =
'Ballard'),(select the_geom from neighborhoods where name =
'Georgetown'));
      distance      
--------------------
 0.0982236357558739

My question is, what do these return values *mean*? I read in the FAQ
that "ST_Distance always returns in the units of the projection." which
I assume applies to other functions as well.  And my understanding is
that the units of the projection is determined by the SRID, and if
that's wrong then any conclusions derived from it would be wrong as
well.  Right?  So I'm kind of stuck here.  Is the -1 SRID really a
problem?  How do I find the real SRID if it is?

Thanks for your help,
David




More information about the postgis-users mailing list