[mapserver-users] Mapserver, OpenStreetMap and hstore - great new possibilities
Hi, For those playing with OpenStreetMap data: it is worth knowing that it is now possible to import all the tags that exists in the OpenStreetMap data into PostGIS. New version of osm2pgsql has an option to import just everything into PosgreSQL column of type hstore. I do not know what it is actually but it behaves like a garden shed and collects all the junk that exists, with the difference that from hstore it is also possible to find something. I had a try by importing some OSM data into PostGIS and making a Mapserver layer that queries the hstore column. LAYER DATA is something like this: DATA way from (select (way),osm_id,tags from osm_point where (tags @'amenity=cafe')) as foo using unique osm_id using srid=2393 This layer shows now all the points which have amenity=cafe tag in the OSM data. Layer can also be make to dynamic one by using variables DATA way from (select (way),osm_id,tags from osm_point where (tags @'%tag%=%value%')) as foo using unique osm_id using srid=2393 By adding tag=somethingvalue=somevalue into WMS GetMap request I can show on a map just enything that I want from OSM data. And GetFeatureInfo can show all the tags of the queried feature, see a QGis example at http://wiki.openstreetmap.org/wiki/User_talk:JRA -Jukka Rahkonen- ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
[mapserver-users] Strange code in maporaclespatial.c
Hi When I compiled mapserver 5.6.3 I got a warning, that a variable may be used without initialization. maporaclespatial.c; line 1322/1331: Code looks indeed a bit strange ... static void osPointCluster(msOracleSpatialHandler *hand, shapeObj *shape, SDOGeometryObj *obj, int start, int end, lineObj points, int interpretation, int data3d, int data4d) { int n; //n = (end - start)/2; //n = interpretation; // //if (n == interpretation) // { points.point = (pointObj *)malloc( sizeof(pointObj)*n ); n is used in malloc without any defined value ... Bye, Benedikt ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] Mapserver, OpenStreetMap and hstore - great new possibilities
This was already possible when setting the --slim option whilst using osm2pgsql. Only issue is that when doing so, you get columns that contain arrays with key/value pairs. But when installing the arrayint postgresql extension it is not to hard to write a couple of functions for the database to make these arrays searchable. Kind regards, Milo van der Linden ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] Testing KML support
Hi Peter, I have updated the RFC after some cleanup in the code (http://svn.osgeo.org/mapserver/branches/branch-5-6/docs/en/development/rfc/ms-rfc-58.txt). Note also that there is a componenent Output-KML in MapServer trac (http://trac.osgeo.org/mapserver/), for reporting issues. best regards, On 07/05/2010 5:02 PM, Yewondwossen Assefa wrote: Hi Peter, There is supposed to be --with-kml. I have added the OUTPUT=KML if built with the flag. Note that the driver is still in development/cleanup state. I will update the RFC (http://mapserver.org/development/rfc/ms-rfc-58.html) once this phase is over. regards, On 07/05/2010 12:23 PM, Peter Hopfgartner wrote: Hi, I'm would like to look at the KML functionality in the current MapServer trunk. There does not seem to be any specific option in configure, so I enabled it by setting the environment variable CPPFLAGS: $ export CPPFLAGS=-DUSE_KML $ ./configure --with-proj --with-postgis --with-cairovim --with-xml2-config=/usr/bin/xml2-config $ make The resulting shp2img has a lot of Kml-related symbols in it: $ nm shp2img | grep -i kml | wc -l 71 Anyway, KML does not seem to be oin the OUTPUT formats list: [peter.hopfgart...@vm-centos5-64-1 mapserver]$ ./shp2img -v MapServer version 5.7-dev OUTPUT=GIF OUTPUT=PNG OUTPUT=JPEG OUTPUT=WBMP OUTPUT=SVG SUPPORTS=PROJ SUPPORTS=AGG SUPPORTS=FREETYPE SUPPORTS=ICONV SUPPORTS=WMS_SERVER INPUT=JPEG INPUT=POSTGIS INPUT=SHAPEFILE Indeed, trying to produce some KML from a map file, I get: $ /usr/local/bin/shp2img -i KML -m kml_test.map test.kml loadOutputFormat(): General error message. OUTPUTFORMAT clause references driver KML, but this driver isn't configured.br Am I missing something? Regards, Peter -- Assefa Yewondwossen Software Analyst Email: yass...@dmsolutions.ca http://www.dmsolutions.ca/ Phone: (613) 565-5056 (ext 14) Fax: (613) 565-0925 ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] Mapserver, OpenStreetMap and hstore - great new possibilities
Hi, Do you mean the tags colums in tables osm_nodes and osm_rels? They do not look quite the same for me. I have thought that slim mode also imports only those tags which are included in the default.style file while the new -k option imports them all automatically. But even if I am wrong you told what's the difference. I can reveal that for me writing a couple of PostgreSQL functions _is_ hard (well, don't know for sure because I have never tried to program anything) while it did not took more than a day to make select from hstore to work inside mapfile's DATA. In addition hstore can be indexed with gin or gist indexes and they seem to work pretty well. -Jukka- -Alkuperäinen viesti- Lähettäjä: mapserver-users-boun...@lists.osgeo.org puolesta: Milo van der Linden Lähetetty: to 20.5.2010 18:17 Kopio: mapserver-users@lists.osgeo.org Aihe: Re: [mapserver-users] Mapserver, OpenStreetMap and hstore - greatnew possibilities This was already possible when setting the --slim option whilst using osm2pgsql. Only issue is that when doing so, you get columns that contain arrays with key/value pairs. But when installing the arrayint postgresql extension it is not to hard to write a couple of functions for the database to make these arrays searchable. Kind regards, Milo van der Linden ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
[mapserver-users] Postgis query bug?
Hi, I can't get an error with teh sql via psql, but only mapserver, so I'll ask here. I'm using a mapfile with a DATA statement similar to the ones at: http://mapserver.org/input/vector/postgis.html The data statement is below... The random() field, combined with order by limit is to generate a random subset of records from each query. I can order by a genuine int field get the expected result in mapserver (WFS) response. I can order by a calculated field 'random() as rand' and get the expected random sorted list back. I can impose a limit 5 on the fixed order by field, get the 5 records back. All work with the SQL in the psql commandline the mapfile. However, if I try to order by rand then limit 5, it works fine from the command line, but returns no records/features via WFS/mapserver. So, with teh layer below, if I change the field to order by to atlas_id (an int in the view being queried) it works. If I leave the order by as rand (random() as rand in the view being queried) with no limit 5 I get a valid response with some 250 records via WFS, if I use limit n with the datasets ordered by rand, I get zero records returned via WFS, but the metadata shows the data extent to be correct. Any advice appreciated... Brent Wood DATA startp from ( select atlas_id, filename, startp, rand from t_station t, V_atlas_id a where t.trip_code = 'tan0906' and t.station_no = 241 and t.station_no=a.station_no and t.trip_code=a.trip_code order by rand limit 5 ) as myquery using unique atlas_id using srid=4326 ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users