[prev in list] [next in list] [prev in thread] [next in thread] 

List:       postgis-users
Subject:    Re: [postgis-users] Problem trying to import data from
From:       Bryan Montgomery <monty () english ! net>
Date:       2009-12-21 17:25:15
Message-ID: ba6ead980912210925s6b6f0a1w262436d00373199b () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


 Thanks, yes that was my mistake in this case and was why postgresql was
crashing (a slightly different id was used on the other version of
postgresql).

That said, I now used this sql:
INSERT into spatial_ref_sys (srid, auth_name, auth_srid, proj4text, srtext)
values ( 96630, 'sr-org', 6630,
'+proj=aea +lat_1=29.5 +lat_2=45.5 +lat_0=23 +lon_0=-96 +x_0=0 +y_0=0
+ellps=GRS80 +datum=NAD83 +units=m +no_defs ',
'PROJCS["NAD_1983_Albers",GEOGCS["NAD83",
DATUM["North_American_Datum_1983",SPHEROID["GRS
1980",6378137,298.257222101,AUTHORITY["EPSG","7019"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY \
["EPSG","6269"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.017453 \
2925199433,AUTHORITY["EPSG","9108"]],AUTHORITY["EPSG","4269"]],PROJECTION["Albers_Coni \
c_Equal_Area"],PARAMETER["standard_parallel_1",29.5],PARAMETER["standard_parallel_2",4 \
5.5],PARAMETER["latitude_of_center",23],PARAMETER["longitude_of_center",-96],PARAMETER["false_easting",0],PARAMETER["false_northing",0],UNIT["meters",1]]');
 (copied from
http://code.google.com/p/bpgeo/source/browse/trunk/ubuntu_build/install_all.sh
).

Initially I thought that it was still wrong, as it gave back some values I'm
not used to working with (we typically only work in South East NY). However,
after testing more thoroughly, it does seem to have resolved the issue.
Thanks for pointing out my omission and making me double check the data :)
Would it make any sense to include this reference in the spatial ref sys as
a default - or is it just the Feds being difficult and obscure :)

Bryan.

------------------------------
> 
> It looks like your insert statement is missing the proj4 text string.
> PostGIS doesn't use the spatialreference wkt at all, rather, it
> delegates it's transformations to proj4.
> 
> Bryan Montgomery wrote:
> > Hi,
> > We've bene trying to import shape files from the website here. (RI is
> > relatively small). I can display the shape files on udig, but have not
> > been able to use shp2pgsql to import them an make sense of it.
> > 
> > I tried running INSERT into spatial_ref_sys (srid, auth_name,
> > auth_srid, proj4text, srtext)
> > values ( 924, 'sr-org', 24, '',
> > 
> 'PROJCS["NAD_1983_Albers",GEOGCS["GCS_North_American_1983",DATUM["D_North_American_1 \
> 983",SPHEROID["GRS_1980",6378137.0,298.257222101]],PRIMEM["Greenwich",0.0],UNIT["Deg \
> ree",0.017453292519943295]],PROJECTION["Albers"],PARAMETER["False_Easting",00000.0], \
> PARAMETER["False_Northing",0.0],PARAMETER["Central_Meridian",-96.0],PARAMETER["Stand \
> ard_Parallel_1",29.5],PARAMETER["Standard_Parallel_2",45.5],PARAMETER["Latitude_Of_Origin",23.0],UNIT["Meter",1.0]]');
> 
> > and use that as the srid of the imported data. Trying to st_transofrm
> > that to 4326 or 32015 on windows with postgresql 8.4.1 crashed the
> > server. We've also run it on 8.2 on linux - which doesn't die.
> > 
> > However, the results are essentially garbage. I assume there is
> > something (probably simple) that we are missing. Can someon point us
> > in the right direction to get this converted?
> > 
> > From what I can tell, udig sees thespatial reference as posted below.
> > I used a link from
> > http://spatialreference.org/ref/sr-org/24/postgis/ as the basis for
> > creating the srid above.
> > PROJCS["NAD_1983_Albers",
> > GEOGCS["GCS_North_American_1983",
> > DATUM["D_North_American_1983",
> > SPHEROID["GRS_1980", 6378137.0, 298.257222101]],
> > PRIMEM["Greenwich", 0.0],
> > UNIT["degree", 0.017453292519943295],
> > AXIS["Lon", EAST],
> > AXIS["Lat", NORTH]],
> > PROJECTION["Albers_Conic_Equal_Area"],
> > PARAMETER["central_meridian", -96.0],
> > PARAMETER["latitude_of_origin", 23.0],
> > PARAMETER["standard_parallel_1", 29.5],
> > PARAMETER["false_easting", 0.0],
> > PARAMETER["false_northing", 0.0],
> > PARAMETER["standard_parallel_2", 45.5],
> > UNIT["m", 1.0],
> > AXIS["x", EAST],
> > AXIS["y", NORTH]]
> > Thanks,
> > Bryan.
> > 
> > 
> > ------------------------------------------------------------------------
> > 
> > _______________________________________________
> > postgis-users mailing list
> > postgis-users@postgis.refractions.net
> > http://postgis.refractions.net/mailman/listinfo/postgis-users
> > 
> 
> 
> ------------------------------
> 
> _______________________________________________
> postgis-users mailing list
> postgis-users@postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
> 
> 
> End of postgis-users Digest, Vol 90, Issue 6
> ********************************************
> 


[Attachment #5 (text/html)]

<div class="gmail_quote"><div> Thanks, yes that was my mistake in this case and was \
why postgresql was crashing (a slightly different id was used on the other version of \
postgresql).<br><br>That said, I now used this sql:<br> INSERT into spatial_ref_sys \
(srid, auth_name, auth_srid, proj4text, srtext) <br>values ( 96630, &#39;sr-org&#39;, \
6630, <br>&#39;+proj=aea +lat_1=29.5 +lat_2=45.5 +lat_0=23 +lon_0=-96 +x_0=0 +y_0=0 \
+ellps=GRS80 +datum=NAD83 +units=m +no_defs &#39;, <br> \
&#39;PROJCS[&quot;NAD_1983_Albers&quot;,GEOGCS[&quot;NAD83&quot;,                  \
DATUM[&quot;North_American_Datum_1983&quot;,SPHEROID[&quot;GRS \
1980&quot;,6378137,298.257222101,AUTHORITY[&quot;EPSG&quot;,&quot;7019&quot;]],TOWGS84 \
[0,0,0,0,0,0,0],AUTHORITY[&quot;EPSG&quot;,&quot;6269&quot;]],PRIMEM[&quot;Greenwich&q \
uot;,0,AUTHORITY[&quot;EPSG&quot;,&quot;8901&quot;]],UNIT[&quot;degree&quot;,0.0174532 \
925199433,AUTHORITY[&quot;EPSG&quot;,&quot;9108&quot;]],AUTHORITY[&quot;EPSG&quot;,&qu \
ot;4269&quot;]],PROJECTION[&quot;Albers_Conic_Equal_Area&quot;],PARAMETER[&quot;standa \
rd_parallel_1&quot;,29.5],PARAMETER[&quot;standard_parallel_2&quot;,45.5],PARAMETER[&q \
uot;latitude_of_center&quot;,23],PARAMETER[&quot;longitude_of_center&quot;,-96],PARAME \
TER[&quot;false_easting&quot;,0],PARAMETER[&quot;false_northing&quot;,0],UNIT[&quot;meters&quot;,1]]&#39;);<br>
 (copied from <a href="http://code.google.com/p/bpgeo/source/browse/trunk/ubuntu_build \
/install_all.sh">http://code.google.com/p/bpgeo/source/browse/trunk/ubuntu_build/install_all.sh</a>).<br><br>Initially \
I thought that it was still wrong, as it gave back some values I&#39;m not used to \
working with (we typically only work in South East NY). However, after testing more \
thoroughly, it does seem to have resolved the issue. Thanks for pointing out my \
omission and making me double check the data :) Would it make any sense to include \
this reference in the spatial ref sys as a default - or is it just the Feds being \
difficult and obscure :)<br> <br>Bryan.<br><br></div><blockquote class="gmail_quote" \
style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; \
padding-left: 1ex;">------------------------------<br> <br>
It looks like your insert statement is missing the proj4 text string.<br>
PostGIS doesn&#39;t use the spatialreference wkt at all, rather, it<br>
delegates it&#39;s transformations to proj4.<br>
<br>
Bryan Montgomery wrote:<br>
&gt; Hi,<br>
&gt; We&#39;ve bene trying to import shape files from the website here. (RI is<br>
&gt; relatively small). I can display the shape files on udig, but have not<br>
&gt; been able to use shp2pgsql to import them an make sense of it.<br>
&gt;<br>
&gt; I tried running INSERT into spatial_ref_sys (srid, auth_name,<br>
&gt; auth_srid, proj4text, srtext)<br>
&gt; values ( 924, &#39;sr-org&#39;, 24, &#39;&#39;,<br>
&gt; &#39;PROJCS[&quot;NAD_1983_Albers&quot;,GEOGCS[&quot;GCS_North_American_1983&quot \
;,DATUM[&quot;D_North_American_1983&quot;,SPHEROID[&quot;GRS_1980&quot;,6378137.0,298. \
257222101]],PRIMEM[&quot;Greenwich&quot;,0.0],UNIT[&quot;Degree&quot;,0.01745329251994 \
3295]],PROJECTION[&quot;Albers&quot;],PARAMETER[&quot;False_Easting&quot;,00000.0],PAR \
AMETER[&quot;False_Northing&quot;,0.0],PARAMETER[&quot;Central_Meridian&quot;,-96.0],P \
ARAMETER[&quot;Standard_Parallel_1&quot;,29.5],PARAMETER[&quot;Standard_Parallel_2&quo \
t;,45.5],PARAMETER[&quot;Latitude_Of_Origin&quot;,23.0],UNIT[&quot;Meter&quot;,1.0]]&#39;);<br>


&gt; and use that as the srid of the imported data. Trying to st_transofrm<br>
&gt; that to 4326 or 32015 on windows with postgresql 8.4.1 crashed the<br>
&gt; server. We&#39;ve also run it on 8.2 on linux - which doesn&#39;t die.<br>
&gt;<br>
&gt; However, the results are essentially garbage. I assume there is<br>
&gt; something (probably simple) that we are missing. Can someon point us<br>
&gt; in the right direction to get this converted?<br>
&gt;<br>
&gt; From what I can tell, udig sees thespatial reference as posted below.<br>
&gt; I used a link from<br>
&gt; <a href="http://spatialreference.org/ref/sr-org/24/postgis/" \
target="_blank">http://spatialreference.org/ref/sr-org/24/postgis/</a> as the basis \
for<br> &gt; creating the srid above.<br>
&gt; PROJCS[&quot;NAD_1983_Albers&quot;,<br>
&gt;   GEOGCS[&quot;GCS_North_American_1983&quot;,<br>
&gt;     DATUM[&quot;D_North_American_1983&quot;,<br>
&gt;       SPHEROID[&quot;GRS_1980&quot;, 6378137.0, 298.257222101]],<br>
&gt;     PRIMEM[&quot;Greenwich&quot;, 0.0],<br>
&gt;     UNIT[&quot;degree&quot;, 0.017453292519943295],<br>
&gt;     AXIS[&quot;Lon&quot;, EAST],<br>
&gt;     AXIS[&quot;Lat&quot;, NORTH]],<br>
&gt;   PROJECTION[&quot;Albers_Conic_Equal_Area&quot;],<br>
&gt;   PARAMETER[&quot;central_meridian&quot;, -96.0],<br>
&gt;   PARAMETER[&quot;latitude_of_origin&quot;, 23.0],<br>
&gt;   PARAMETER[&quot;standard_parallel_1&quot;, 29.5],<br>
&gt;   PARAMETER[&quot;false_easting&quot;, 0.0],<br>
&gt;   PARAMETER[&quot;false_northing&quot;, 0.0],<br>
&gt;   PARAMETER[&quot;standard_parallel_2&quot;, 45.5],<br>
&gt;   UNIT[&quot;m&quot;, 1.0],<br>
&gt;   AXIS[&quot;x&quot;, EAST],<br>
&gt;   AXIS[&quot;y&quot;, NORTH]]<br>
&gt; Thanks,<br>
&gt; Bryan.<br>
&gt;<br>
&gt;<br>
&gt; ------------------------------------------------------------------------<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; postgis-users mailing list<br>
&gt; <a href="mailto:postgis-users@postgis.refractions.net">postgis-users@postgis.refractions.net</a><br>
 &gt; <a href="http://postgis.refractions.net/mailman/listinfo/postgis-users" \
target="_blank">http://postgis.refractions.net/mailman/listinfo/postgis-users</a><br> \
&gt;<br> <br>
<br>
------------------------------<br>
<br>
_______________________________________________<br>
postgis-users mailing list<br>
<a href="mailto:postgis-users@postgis.refractions.net">postgis-users@postgis.refractions.net</a><br>
 <a href="http://postgis.refractions.net/mailman/listinfo/postgis-users" \
target="_blank">http://postgis.refractions.net/mailman/listinfo/postgis-users</a><br> \
<br> <br>
End of postgis-users Digest, Vol 90, Issue 6<br>
********************************************<br>
</blockquote></div><br>



_______________________________________________
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic