[mapserver-users] join shp with csv

Jörg Thomsen jt at mapmedia.de
Thu Mar 13 09:29:57 PDT 2014


boah, your right, thanks!

so the join only works with html-templates / text/html output. with
text/plain I only see the attributes of the shapefile.
(And I tested with text/plain....)

You saved my day, Jörg

Am 13.03.2014 16:59, schrieb Brent Fraser:
> Jörg,
> 
> According to the JOIN doc (mapserver.org/mapfile/join.html) on CSV, your
> template should use
> 
> name_join: [test_2]</br>
> 
> where [test_2] is a concatenation of your JOIN NAME ("test") and the
> column id (2) in the CSV file.
> 
> Best Regards,
> Brent Fraser
> 
> On 3/13/2014 8:09 AM, Jörg Thomsen wrote:
>> Am 13.03.2014 14:39, schrieb Rahkonen Jukka (Tike):
>>> Hi,
>>>
>>> I have had no time to look at your files but I see that ogrinfo
>>> reports osm_id as a string. Write .csvt file
>>> http://www.gdal.org/ogr/drv_csv.html for converting it to integer,
>>> perhaps join requires same data types.
>> good idea, thanks.
>> But doesn't help.
>>
>> I have updated the online files, perhaps you'll have some time within
>> the next few days.
>>
>> Jörg
>>
>>> -Jukka Rahkonen-
>>>
>>> Jörg Thomsen wrote:
>>>
>>>> Hello Jeff,
>>>>
>>>> yes, this looks better.
>>>>> $ ogrinfo ./shapes_join/join.csv join -summary
>>>>> INFO: Open of `./shapes_join/join.csv'
>>>>>        using driver `CSV' successful.
>>>>>
>>>>> Layer name: join
>>>>> Geometry: None
>>>>> Feature Count: 208
>>>>> Layer SRS WKT:
>>>>> (unknown)
>>>>> osm_id: String (0.0)
>>>>> name_join: String (0.0)
>>>> but the join in mapserver still doesn't work.
>>>>
>>>> Jörg
>>>>
>>>>
>>>> Am 13.03.2014 13:39, schrieb Jeff McKenna:
>>>>> On 2014-03-13, 9:36 AM, Jeff McKenna wrote:
>>>>>> On 2014-03-13, 7:07 AM, Jörg Thomsen wrote:
>>>>>>>
>>>>>>> $ 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.
>>>>>>>
>>>>>> You seem to be following my examples very closely from
>>>>>> http://www.mapserver.org/mapfile/join.html#example-3-join-from-shape-
>>>>>> dataset-to-csv-file which is good, but be careful, "lookup" in my
>>>>>> example is the OGR layername; in your case it will be different.  You
>>>>>> should just try "ogrinfo join.csv" to get a list of available layers
>>>>>> through OGR.  See some examples of that in action:
>>>>>> http://mapserver.org/input/vector/ogr.html#how-to-use-ogrinfo
>>>>>>
>>>>> Ah but I almost forgot the most important switch for layernames:
>>>>> ""ogrinfo join.csv -summary"
>>>>>
>>>>> Good luck there!
>>>>>
>>>>> -jeff
>>>>>
>>>>>
>>>>>
>>>>>
>>>> _______________________________________________
>>>> mapserver-users mailing list
>>>> mapserver-users at lists.osgeo.org
>>>> http://lists.osgeo.org/mailman/listinfo/mapserver-users
>>> _______________________________________________
>>> mapserver-users mailing list
>>> mapserver-users at lists.osgeo.org
>>> http://lists.osgeo.org/mailman/listinfo/mapserver-users
>>>
>> _______________________________________________
>> 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