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

David Jantzen david at culturemob.com
Thu May 15 12:23:42 PDT 2008


Sorry for the delayed response; I never got my message digest so I'm
looking at the web archive to follow the discussion.  Thanks for your
help!

Paul: I added the continental US projection, and also had to add one for
the 4326 projection.  Is there more verbose documentation of these
projections somewhere?  I'm looking at spatial_ref_sys.sql and it's
rather ... terse :)

Andy: Thanks for the clarification.

Bruce: I understand there's a huge conceptual foundation I'm missing
here.  Is there particular introductory material you would recommend?  I
should note that my goals are (I think) pretty modest.  I need to map
lat/longs into neighborhoods, and perform distance queries so that our
users can restrict their search range to X number of miles from their
homes.  

Thanks,
David

On Wed, 2008-05-14 at 15:13 -0700, David Jantzen wrote:
> 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