[postgis-users] architectural status of shp2pgsql?

Alex Smith msestudiente2 at yahoo.com
Sun Jul 3 11:35:37 PDT 2005


You asked about the contents of a prj file.....  prj files are essentially text files that list SR data.  Here is a prj file for a GCS/lat-long NAD83 shapefile (EPSG SRID 4269):
 
<begin prj file>
GEOGCS["GCS_North_American_1983",DATUM["D_North_American_1983",SPHEROID["GRS_1980",6378137.0,298.257222101]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]]
<end prj file>
 
Ironically, it looks very, very similar to the data contained in "SELECT spatial_ref_sys.srtext FROM spatial_ref_sys WHERE spatial_ref_sys.SRID = 4269;" which is below:

GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101,AUTHORITY["EPSG","7019"]],AUTHORITY["EPSG","6269"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.01745329251994328,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4269"]]

Don't quote me on this, but it seems that ESRI needed a way to store SR data for shapefiles long after the shapefile had been invented.  So it seems that they piggybacked on the EPSG system.  Due to the extreme similarities, it seems that it may be possible to parse the data in the prj file and 'match' it to an entry in spatial_ref_sys.
 
AS

strk at refractions.net wrote:
On Sun, Jul 03, 2005 at 09:59:50AM -0700, gold wrote:
> shp2pgsql is nice, but i'm either going to radically modify my local 
> version, or cut something new, and i'm wondering if there is any planned 
> or ongoing work to that effect?
> 
> in particular, i'd like to see the functionality split a bit, as well as 
> some things added:

What revision are you using ?
I've put some efforts to split functionalities a bit in recent ones.

> * split up the metadata sniffing/table creation part into a separate module
> 
> * use this module in two places -- shp2pgsql and dbf2pgsql (to be 
> created). i realize (from the discussion in march, i think) that there 
> is a dbf2pg in the postgres contrib, but it's not much to my liking. 
> also, i'd like to have shp2pgsql and dbf2pgsql running off of a common 
> io and metadata core.

My proposal was to let shp2pgsql read .dbf files w/out corresponding
shp in case shp were missing.

> * add projection (.prj) capabilities to shp2pgsql.
> 
> are there already efforts to do this stuff, or, if not, and i end up 
> doing the work, are there people out there willing to do code reviews 
> and provide some other guidance?

There are no efforts I'm aware of. I think main problem would be
finding a match or create a new record in spatial_ref_sys.
Maybe first step should be some utility functions to query spatial_ref_sys
given a set of definitions. What does .prj files contain ?

-strk;
_______________________________________________
postgis-users mailing list
postgis-users at postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users

		
---------------------------------
Yahoo! Sports
 Rekindle the Rivalries. Sign up for Fantasy Football
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20050703/c61ef494/attachment.html>


More information about the postgis-users mailing list