[mapserver-users] join shp with csv

Rahkonen Jukka (Tike) jukka.rahkonen at mmmtike.fi
Thu Mar 13 03:41:41 PDT 2014


Hi,

Could you send the whole LAYER section? And if you can put a small shapefile to download I can have a try.
About ogrinfo, your command is searching for layer "lookup" from csv file join.csc. It does not have such layer, it has exactly one layer and it is "join". So do
ogrinfo join.csv join -summary

This is not your fault, obviously the one who wrote the documentation remembers all the GDAL commands with eyes shut but author did not remember that documentation is meant for wider audience. I would have written the command without layer name but used the generally working switch -al (all layers) instead.
 
ogrinfo -al -so lookup.csv

-Jukka Rahkonen-


Jörg Thomsen wrote:


 
> hi again,
> 
> I am still preparing my MapServer workshop for FOSGISS in Berlin next week.
> Last topic is a join-example and I cannot get it to work :(
> 
> this is my join in the layer:
> >   JOIN
> >     NAME "test"
> >     CONNECTIONTYPE CSV
> >     TABLE "./shapes_join/join.csv"
> >     FROM "osm_id"
> >     TO "1"
> > #    TO "0"
> > #    TO "tab_1"
> > #    TO "osm_id"
> >     TYPE ONE-TO-ONE
> >   END
> 
> the first lines of the csv:
> > osm_id;name_join
> > 21484050;Karlshorst
> > 21484076;Schmöckwitz
> > 21484102;Adlershof
> > 27380127;Bohnsdorf
> > 28094136;Schöneberg
> 
> and here is the featureonfo-output:
> GetFeatureInfo results:
> 
> Layer 'places'
>   Feature 137:
>     osm_id = '560483810'
>     name = 'Neu-Hohenschönhausen'
>     type = 'suburb'
>     population = '''
> 
> no 'name_join' :(
> 
> tried upper und lower cases for column-names
> 
> funny: the only output in errorlog (level5) is:
> > [Thu Mar 13 10:48:52 2014].209278 msSearchDiskTree(): Search returned no
> results. Unable to open spatial index for
> /home/user/data/mapserverIIWS/./shapes_join/places_join.qix. In most cases
> you can safely ignore this message, otherwise check file names and permissions.
> > [Thu Mar 13 10:48:52 2014].209678 freeLayer(): freeing layer at 0x9451cd8.
> 'Search returned no results.' but there are results....
> 
> 
> $ ogrinfo join.csv lookup -summary
>  INFO: Open of `join.csv'
>        using driver `CSV' successful.
>  FAILURE: Couldn't fetch requested layer lookup!
> 
> This is my only hint but unfortunatly I don't know what ogr wants to tell me.
> 
> regards, Jörg
> 
> 
> --
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> Aufwind durch Wissen!
> 
> Qualifizierte Open Source Schulungen bei der http://www.foss-akademie.de/
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 
> 
> _________________________________________________
> 
> MapMedia
> Kartographie und raumbezogene Informationssysteme
> 
> Gillweg 3, 14193 Berlin
> fon: +49 30 89 06 82-70
> fax: +49 30 89 09 53-21
> mail: jt at mapmedia.de
> net:  www.mapmedia.de
> _________________________________________________
> 
> 
> Geschäftsführer: G. v. Tschirnhaus, J. Thomsen, P. Stamm Registergericht, Berlin
> - Amtsgericht Charlottenburg, HRB 89625, Umsatzsteuer-Identnummer: DE
> 813794062 _______________________________________________
> mapserver-users mailing list
> mapserver-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapserver-users


More information about the mapserver-users mailing list