[postgis-users] Shapes to PG

Neil.Young Neil.Young at Freenet.de
Sun Jan 25 10:32:04 PST 2009


Hi Mark,

thanks for your answer. In fact, I could produce a SQL file with 
shp2psql. The SRID, I choose, was 31467, which is OK for GK 3, I think. 
I also could import it into the postgis db, but just a couple of lines 
do have the_geometry values. Most don't have one. E.g. Flensburg, which 
appears in the SQL file as:

INSERT INTO "onb" ("vorwahl","name","kennung",the_geom) VALUES 
('0461','Flensburg',NULL,'SRID=31467;010600000001000000010300000001000000F80000000000002877DF4A41000000346E2C57410000006407DF4A410000002C932C5741000000742DDF4A4100000068F82C5741000000F097DF4A410000002CEE2C5741000000547AE04A410000003C9A2D57410000004CA9E04A4100000010C22D57410000000CE9E04A41000000B0DC2D57410000003C1EE14A4100000080EC2D5741000000B053E14A41000000B0F02D57410000008C86E14A4100000038EA2D5741000000149DE14A4100000010E02D5741000000D8A8E14A4100000058E12D57410000004CA2E14A41000000B0F92D5741000000C0B6E14A41000000100E2E574100000078E1E14A4100000068202E57410000006807E24A4100000098322E5741000000C82AE24A410000003C3E2E57410000003C37E24A410000003C492E5741000000C48EE24A41000000E4552E574100000024C7E24A4100000004662E57410000003CF9E24A4100000040852E574100000054D7E24A41000000349E2E5741000000C4F2E24A41000000DCAC2E57410000001004E34A41000000DCC52E574100000088FEE24A4100000080E92E57410000009C0CE34A4100000088FA2E57410000004C22E34A4100000044042F5741000000F81EE34A41000000C8262F57410000008C24E34A41000000D0452F5741000000483AE34A41000000F45B2F5741000000183AE34A410000004C742F5741000000DC11E34A410000003C942F5741000000500BE34A4100000024AB2F57410000000416E34A410000005CD42F57410000002828E34A4100000090D72F5741000000583AE34A4100000084E32F57410000001062E34A4100000008DD2F57410000001C91E34A4100000084D72F5741000000B4B6E34A410000007CE32F574100000068C6E34A41000000D0F82F5741000000B8CFE34A41000000040A305741000000CCE3E34A410000006C1330574100000028E6E34A410000009C2B30574100000020DCE34A41000000704730574100000084E3E34A41000000A058305741000000E8F8E34A410000006065305741000000A806E44A410000003074305741000000C834E44A410000005C75305741000000C49BE44A41000000EC6B3057410000003024E54A410000006065305741000000C880E54A41000000046F3057410000008CDAE54A410000008C7E3057410000005002E64A410000002081305741000000B033E64A410000006C8D3057410000009084E64A410000009CA03057410000008099E64A4100000098963057410000007CA6E64A41000000008B305741000000B4B5E64A4100000028813057410000004CC5E64A4100000098823057410000007C1EE74A4100000028DB305741000000303AE74A4100000064E1305741000000007CE74A410000007CDD30574100000090A6E74A4100000004D33057410000003CE1E74A410000004CB2305741000000C01FE84A410000001C98305741000000182CE84A41000000708A305741000000B438E84A41000000FC743057410000006C60E84A410000008C6D3057410000009C70E84A4100000094693057410000006887E84A4100000064553057410000004088E84A41000000D03E305741000000D065E84A41000000942D3057410000004045E84A4100000000163057410000009834E84A4100000014FF2F57410000009040E84A41000000A8E82F5741000000045EE84A4100000004D02F5741000000D07CE84A41000000C8C72F57410000001CA7E84A4100000098C52F5741000000B4D6E94A41000000D4302F574100000090B0EA4A4100000088312F57410000000475EC4A410000004CD02F574100000090CDED4A41000000A0E22F5741000000C82BEE4A4100000070B42F57410000004C94F04A41000000404B30574100000068E6F14A4100000034A12E5741000000D4DBF14A41000000B4922E574100000028F2F14A4100000084622E5741000000D0B3F14A41000000C05F2E57410000003CCEF14A41000000ACEA2D5741000000E005F24A4100000070E62D57410000007029F24A4100000040DD2D5741000000C436F24A41000000F0D52D57410000000C5CF24A4100000024E42D5741000000F077F24A410000008CD12D57410000000CB2F24A41000000F4BF2D57410000002CFBF24A41000000B0A92D5741000000EC3AF34A4100000000872D57410000000C6CF34A41000000F06B2D5741000000F084F34A41000000445A2D5741000000107CF34A4100000050422D5741000000A880F34A410000003C372D5741000000104EF34A4100000058202D5741000000A444F34A41000000440E2D57410000001871F34A41000000C0D12C57410000005013F34A41000000E8D02C5741000000C8E5F24A4100000078CA2C574100000040DEF24A41000000F0B02C5741000000341FF34A41000000B48F2C57410000003051F34A41000000D07E2C57410000000057F34A41000000F85D2C57410000002880F34A41000000805A2C57410000005496F34A41000000E4542C5741000000F49CF34A41000000303F2C5741000000A05FF34A41000000382E2C5741000000BC2FF34A410000004C232C574100000068F9F24A4100000090122C5741000000DCEBF24A41000000C40D2C5741000000B0E0F24A4100000018FA2B574100000034DBF24A41000000A4E62B574100000090EBF24A4100000020D52B5741000000C4FDF24A4100000078D12B57410000005816F34A4100000088B52B57410000005C3AF34A41000000B0992B57410000007065F34A4100000008862B57410000000895F34A41000000887A2B57410000007CAEF34A410000009C6C2B574100000068B7F34A4100000048602B5741000000ECB0F34A41000000B84E2B5741000000C0A5F34A410000000C3B2B5741000000B88DF34A41000000D42C2B57410000006072F34A41000000FC232B5741000000F876F34A4100000028132B5741000000D078F34A41000000ACF32A5741000000486BF34A41000000F0D92A5741000000F041F34A4100000010DD2A5741000000745FF34A4100000028A52A5741000000B063F34A41000000D07F2A5741000000F452F34A4100000018452A5741000000B43AF34A410000006C1D2A57410000001832F34A4100000034FD295741000000C456F34A41000000FCC92957410000005075F34A410000007CB0295741000000DC7BF34A41000000689E295741000000FC65F34A41000000C4872957410000003054F34A41000000F871295741000000C859F34A41000000E05F295741000000B067F34A41000000C8562957410000003C84F34A41000000E05629574100000074A4F34A41000000A85029574100000064C9F34A410000003C4129574100000014E2F34A410000009C2C295741000000C4E7F34A410000007C2229574100000014A5F34A4100000048192957410000003C8BF34A410000007C13295741000000E88EF34A41000000B001295741000000E487F34A41000000A4E1285741000000D45CF34A410000008CDE285741000000A042F34A41000000DCD9285741000000E03DF34A41000000B0CE285741000000E439F34A4100000040BE2857410000007029F34A41000000B0B1285741000000E80BF34A41000000B4B22857410000003CF4F24A410000007CB928574100000024C3F24A410000004CCA285741000000B09FF24A41000000E4BC285741000000FC91F24A4100000034A2285741000000F09BF24A41000000A083285741000000B894F24A41000000BC6E2857410000009468F24A410000009464285741000000FC51F24A41000000E85B285741000000145EF24A410000008836285741000000084AF24A410000006412285741000000701BF24A4100000074FC27574100000078F6F14A4100000020ED275741000000B4F2F14A4100000078C62757410000001C0AF24A41000000A09B2757410000005027F24A41000000905B275741000000E8FDF04A41000000E03E2757410000003CB2F04A41000000C436275741000000B492F04A410000009C2F275741000000845DF04A410000008CFB2657410000001C28F04A410000003CD72657410000004898EF4A4100000078AE2657410000006C38EF4A4100000040AB2657410000004405EF4A4100000040B4265741000000E0C4EE4A4100000088CC2657410000007C6EEE4A41000000A8E6265741000000F03EEE4A41000000F4FE265741000000F00DEE4A41000000A81C27574100000024BCED4A41000000F80D275741000000BCA3ED4A41000000D00B275741000000748DED4A41000000D0282757410000007C0CED4A41000000901427574100000088D1EC4A41000000EC0627574100000098B1EC4A41000000B0EF265741000000F09FEC4A41000000CCE22657410000009C4EEC4A4100000040542557410000006CD3EB4A41000000B86C2557410000006884EB4A41000000BC72255741000000D8F6EA4A4100000094892557410000007494EA4A410000009C9825574131A68CD6FBE94A4166C5D596B8255741EF1DD14D78E94A41B90CFB23DB25574100000004DCE84A410000002810265741B1F6237779E84A414CA2B0C6302657416ABD307C41E84A410F882AC30E2657419F93594EDCE74A412BDF16A4D32557412314871C97E74A41253AE59AED2557410000005445E74A410000005C1726574100000030F2E64A41000000D43826574100000010DCE64A41000000A43E265741D7CA8AC8A3E64A415F9B455634265741D7CA8A8C8DE64A415F9B457A3D265741000000E873E64A41000000084F265741000000F484E64A41000000A4B7265741000000D061E64A4100000028BD265741000000803CE64A4100000058D3265741000000FCF3E54A410000001CF1265741000000106EE44A410000002013265741000000D036E44A41000000201B265741000000AC23E44A41000000B0E52557410000004890E34A41000000A4FF25574100000030AEE34A410000003808265741000000BCCBE34A41000000402D265741000000D436E34A410000004CBD265741000000C0CBE24A410000002819275741000000D425E24A410000004C92275741000000207CE24A4100000008B2275741000000A032E24A41000000A81A2857410000001092E24A410000002C3328574100000000FEE14A410000004007295741000000806FE14A41000000688C295741000000F8B2E14A41000000349C295741000000889CE14A410000009CEB2957410000006C64E14A41000000E8F0295741000000FC40E14A41000000182D2A5741000000E005E14A41000000E4232A57410000006405E14A4100000090722A5741000000B0EEE04A4100000040AE2A5741000000E8BFE04A4100000068DE2A57410000000C56E04A410000000C3C2B57410000003022E04A41000000D06B2B57410000009802E04A4100000050B02B57410000001CE2DF4A4100000030042C574100000010C4DF4A4100000094252C57410000001CB1DF4A410000001C3D2C57410000007499DF4A41000000E8632C57410000002877DF4A41000000346E2C5741');

If I copy&paste this line manually into the pgadmin script window, it 
looks as whether the spacial data is not present (don't know, whether I 
can make this clear, so I've attached a screenshot). However, Flensburg 
and others don't have a the_geometry at all...

Kind regards



Mark Cave-Ayland schrieb:
> Neil.Young wrote:
>
>> Hi,
>>
>> I'm trying to import these shapes 
>> http://www.bundesnetzagentur.de/media/archive/11358.zip (found at 
>> http://www.bundesnetzagentur.de/enid/c01bfe3b2435fdc1eb4d7c0c84cc6355,0/Verzeichnisse/ONB-Grenzen_1gj.html) 
>> into a PostgreSQL 8.3/PostGis 1.3.5 database under Windows. The scale 
>> of the shapes is 1:25.000, the projection GK III. I would like to use 
>> a freely available generalization tool, which runs on PG only.
>>
>> I cannot really import the full dataset, neither using shp2pgsql nor 
>> psql nor pgadmin III and whatever tools are available. There is 
>> almost at least one error. Either the "client_endoding" doesn't match 
>> or big chunks of the data don't have a geometry value at all after 
>> the import (e.g. the area of Flensburg). But I'm not very familiar 
>> with PG too. Is anybody of you, using this database, able to give me 
>> a clue?
>>
>> Regards
>
> Hi Neil,
>
> Well, the shapefile provider should tell you what encoding they've 
> supplied the data in as it's a property of the data. However, LATIN1 
> or LATIN9 are quite common choices - simply use the -W flag for 
> shp2pgsql to specify the shapefile encoding and see if you get any 
> further.
>
>
> HTH,
>
> Mark.
>

-------------- next part --------------
A non-text attachment was scrubbed...
Name: pg.JPG
Type: image/jpeg
Size: 94711 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20090125/128f06a7/attachment.jpe>


More information about the postgis-users mailing list