Re: [OSGeo-Discuss] Best tool, shapefile to png, web
Peter, If all you want to do is render a shapefile to a png image using a command line (once? twice? many times?) then mapserver's shp2img is a good solution, or even GDAL's gdal_rasterize (http://www.gdal.org/gdal_rasterize.html). But if you need a web mapping framework (html, javascript, etc) to provide the end-user with pan/zoom, layer selection and other tools, have a look at GeoMoose (http://www.geomoose.org). If you're using Windows, the MS4W package (http://www.maptools.org/ms4w/) can supply the server-side components, including mapserver. With MS4W, you can install Geomoose and start viewing the demo data within minutes. And if you're looking to maximize performance of web mapping apps by pre-rendering, you're talking about Tiling. One of the best explanation of this I've found is at http://www.maptiler.org/. But it doesn't cover how to create tiles of vector data. I've just started to look into this myself by reading the Mapnik doc (http://mapnik.org/)... Best Regards, Brent Fraser Peter wrote: There is lots of documentation[2] and even a book[3]. Definition of a heavy app: one that requires a book. ;-) Honestly it sounds scalable, robust, all round good, and ill take the thing to bed with me for the next month, really, im a map freak. MapServer is not so much a complete server, as just a simple CGI executable (about a megabyte in size). You only need to [...] and it sends you the image file back. So, my web app is going to have to?: - write a map file to the filesystem, something we dont do much anymore in a word of dbs. - open a http socket to a CGI eg http://localhost/cgi-bin/mapserv.exe?map=/ms4w/apps/tutorial/htdocs/example1-1.maplayer=statesmode=map, really? a socket to our own machine... ok. - which writes my png to the filesystem, where i can get at it later. Ive used web gis apps and i know how long they take to render. Thus the app needs to render the pngs either upon shapefile upload or overnite via cron, and store them for subsequent user consumption. I dont require (or want) the users to access the mapserver, hence the whole idea of running it as a cgi is pointless. Is there a way to run it as a binary system call? You can also use it with MapScript for PHP or Python. This sounds promising. Only the documentation for it comprises this: http://mapserver.org/mapscript/introduction.html If i committed to put this together as a php class, and GPL it, would anybody be willing to give me a bit of a road map through the documentation. Regards ___ Discuss mailing list Discuss@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/discuss ___ Discuss mailing list Discuss@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/discuss
Re: [OSGeo-Discuss] Best tool, shapefile to png, web
All, Well, one could go old school, and just store the SHP files as the sourced data. Have mapserver read them directly, either via a dynamically modified index file, or via dynamically built MAPFILE. This would be just about the least amount of moving parts and still get you what you are looking for. I would still suggest moving to a DB a some point, but this would get things organized for a DB move at a later date. bobb Peter web...@pl.net wrote: There is lots of documentation[2] and even a book[3]. Definition of a heavy app: one that requires a book. ;-) Honestly it sounds scalable, robust, all round good, and ill take the thing to bed with me for the next month, really, im a map freak. MapServer is not so much a complete server, as just a simple CGI executable (about a megabyte in size). You only need to [...] and it sends you the image file back. So, my web app is going to have to?: - write a map file to the filesystem, something we dont do much anymore in a word of dbs. - open a http socket to a CGI eg http://localhost/cgi-bin/mapserv.exe?map=/ms4w/apps/tutorial/htdocs/example1-1.maplayer=statesmode=map, really? a socket to our own machine... ok. - which writes my png to the filesystem, where i can get at it later. Ive used web gis apps and i know how long they take to render. Thus the app needs to render the pngs either upon shapefile upload or overnite via cron, and store them for subsequent user consumption. I dont require (or want) the users to access the mapserver, hence the whole idea of running it as a cgi is pointless. Is there a way to run it as a binary system call? You can also use it with MapScript for PHP or Python. This sounds promising. Only the documentation for it comprises this: http://mapserver.org/mapscript/introduction.html If i committed to put this together as a php class, and GPL it, would anybody be willing to give me a bit of a road map through the documentation. Regards ___ Discuss mailing list Discuss@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/discuss ___ Discuss mailing list Discuss@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/discuss
[OSGeo-Discuss] Best tool, shapefile to png, web
Hi Guys and Girls, After an embarrassingly protracted google session, im not doing so well. What i need is to turn a shapefile (from a trimble device) into a png as part of a web app. Ideally it would be the simplist lightest tool/s that can do the job, bearing in mind that im working in php/mysql. I found a script which did the whole thing in php (jjfmapper) which functions except development has stopped, and it doesnt support the version of shapefile i have. (jjfmapper reports it to be type 768) The GDAL/OGR library is reported to do conversions of shapefiles to mysql. Would need to add on the png rendering using GD2. Im sure i dont need to reinvent that. And theres something called mapserver which seems to be a complete service. Sounds heavy. The shapefile concerned contains a moderate number of simple polylines. Ideally the end result would be a png, a world file, and/or going further, being able to overlay the png over an aerial photo or png basemap. If your'e interested a sample shapefile is here: http://www.zoneblue.org/files/BLK1_log.shp.zip with the desired result here: http://www.zoneblue.org/files/BLK1_log.shp.jpg Appreciate any pointers. Regards Peter Scott NZ ___ Discuss mailing list Discuss@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/discuss
Re: [OSGeo-Discuss] Best tool, shapefile to png, web
Peter, Ok, this is all going to sound a bit heavy (to use your words), but in the end you'll have a lot more flexibilty with the end toolset. I would suggest loading the SHP file data into a Database, Mysql would work, but POSTGIS would be better. Then source that Spatial data via MapServer and use in any of a number of image clients. I'm partial to GeoMoose, but Openlayers would work too. Looks like you are tracking farm field tractor locations, by entering things into a Database from the start, over the long haul you'll be able to add in things like temporal reporting as more and more data becomes available. This is where the up front heaviness will pay off. bobb Peter web...@pl.net wrote: Hi Guys and Girls, After an embarrassingly protracted google session, im not doing so well. What i need is to turn a shapefile (from a trimble device) into a png as part of a web app. Ideally it would be the simplist lightest tool/s that can do the job, bearing in mind that im working in php/mysql. I found a script which did the whole thing in php (jjfmapper) which functions except development has stopped, and it doesnt support the version of shapefile i have. (jjfmapper reports it to be type 768) The GDAL/OGR library is reported to do conversions of shapefiles to mysql. Would need to add on the png rendering using GD2. Im sure i dont need to reinvent that. And theres something called mapserver which seems to be a complete service. Sounds heavy. The shapefile concerned contains a moderate number of simple polylines. Ideally the end result would be a png, a world file, and/or going further, being able to overlay the png over an aerial photo or png basemap. If your'e interested a sample shapefile is here: http://www.zoneblue.org/files/BLK1_log.shp.zip with the desired result here: http://www.zoneblue.org/files/BLK1_log.shp.jpg Appreciate any pointers. Regards Peter Scott NZ ___ Discuss mailing list Discuss@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/discuss ___ Discuss mailing list Discuss@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/discuss
Re: [OSGeo-Discuss] Best tool, shapefile to png, web
Hi Peter, if you plan to have more shape files in the future you can use MapServer + Gdal. If you use Linux, GDAL and MapServer are pretty easy to install... it integrates very well with Google Maps and it can read any format supported by gdal. hope that helps.. regards On Mon, Aug 16, 2010 at 9:41 PM, Peter web...@pl.net wrote: Hi Guys and Girls, After an embarrassingly protracted google session, im not doing so well. What i need is to turn a shapefile (from a trimble device) into a png as part of a web app. Ideally it would be the simplist lightest tool/s that can do the job, bearing in mind that im working in php/mysql. I found a script which did the whole thing in php (jjfmapper) which functions except development has stopped, and it doesnt support the version of shapefile i have. (jjfmapper reports it to be type 768) The GDAL/OGR library is reported to do conversions of shapefiles to mysql. Would need to add on the png rendering using GD2. Im sure i dont need to reinvent that. And theres something called mapserver which seems to be a complete service. Sounds heavy. The shapefile concerned contains a moderate number of simple polylines. Ideally the end result would be a png, a world file, and/or going further, being able to overlay the png over an aerial photo or png basemap. If your'e interested a sample shapefile is here: http://www.zoneblue.org/files/BLK1_log.shp.zip with the desired result here: http://www.zoneblue.org/files/BLK1_log.shp.jpg Appreciate any pointers. Regards Peter Scott NZ ___ Discuss mailing list Discuss@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/discuss -- Sebastian E. Ovide ___ Discuss mailing list Discuss@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/discuss
Re: [OSGeo-Discuss] Best tool, shapefile to png, web
There is lots of documentation[2] and even a book[3]. Definition of a heavy app: one that requires a book. ;-) Honestly it sounds scalable, robust, all round good, and ill take the thing to bed with me for the next month, really, im a map freak. MapServer is not so much a complete server, as just a simple CGI executable (about a megabyte in size). You only need to [...] and it sends you the image file back. So, my web app is going to have to?: - write a map file to the filesystem, something we dont do much anymore in a word of dbs. - open a http socket to a CGI eg http://localhost/cgi-bin/mapserv.exe?map=/ms4w/apps/tutorial/htdocs/example1-1.maplayer=statesmode=map, really? a socket to our own machine... ok. - which writes my png to the filesystem, where i can get at it later. Ive used web gis apps and i know how long they take to render. Thus the app needs to render the pngs either upon shapefile upload or overnite via cron, and store them for subsequent user consumption. I dont require (or want) the users to access the mapserver, hence the whole idea of running it as a cgi is pointless. Is there a way to run it as a binary system call? You can also use it with MapScript for PHP or Python. This sounds promising. Only the documentation for it comprises this: http://mapserver.org/mapscript/introduction.html If i committed to put this together as a php class, and GPL it, would anybody be willing to give me a bit of a road map through the documentation. Regards ___ Discuss mailing list Discuss@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/discuss
Re: [OSGeo-Discuss] Best tool, shapefile to png, web
Peter, You want light and easy to start developing your WMS in Windows or in Linux. Get OpenGeo Suite. http://opengeo.org/ # PostGIS # GeoServer # GeoWebCache # OpenLayers # GeoExt Recent version of the Community Edition is 2.1.2. http://opengeo.org/community/suite/download/ Read the WMS Benchmarking - August 16, 2010 (Today's Blog) http://blog.opengeo.org/ You want beautiful maps - Mapnik. OpenStreetMap (OSM) use Mapnik. QuantunNik plugin in QGIS can render Mapnik in QGis can produce beautiful png. http://bitbucket.org/springmeyer/quantumnik/wiki/Home Noli On 8/17/10, Mike Toews mwto...@gmail.com wrote: On 16 August 2010 13:41, Peter web...@pl.net wrote: And theres something called mapserver which seems to be a complete service. Sounds heavy. MapServer is not so much a complete server, as just a simple CGI executable (about a megabyte in size). You only need to craft a MAP file, which is a tricky text file telling the layer source and how it is stylized. You can connect to most things, including MySQL[1] and Shapefiles. To get a PNG, you only need to POST a few parameters to the executable, and it sends you the image file back. You can also use it with MapScript for PHP or Python. There is lots of documentation[2] and even a book[3]. -Mike [1] http://mapserver.org/input/vector/mysql.html [2] http://mapserver.org/introduction.html [3] http://www.apress.com/book/view/1590594908 ___ Discuss mailing list Discuss@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/discuss ___ Discuss mailing list Discuss@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/discuss
Re: [OSGeo-Discuss] Best tool, shapefile to png, web
Thanks for the OpenGeo Suite shout out, but at 250 megs for the download, installing a full database and webserver, I think it's about the furthest thing from light on this list. Hoping to get it to the point where it's a cloud deployment and you could just make what you want to do a handful of api calls, but we're not quite there yet. C On 8/16/10 6:35 PM, Noli Sicad wrote: Peter, You want light and easy to start developing your WMS in Windows or in Linux. Get OpenGeo Suite. http://opengeo.org/ # PostGIS # GeoServer # GeoWebCache # OpenLayers # GeoExt Recent version of the Community Edition is 2.1.2. http://opengeo.org/community/suite/download/ Read the WMS Benchmarking - August 16, 2010 (Today's Blog) http://blog.opengeo.org/ You want beautiful maps - Mapnik. OpenStreetMap (OSM) use Mapnik. QuantunNik plugin in QGIS can render Mapnik in QGis can produce beautiful png. http://bitbucket.org/springmeyer/quantumnik/wiki/Home Noli On 8/17/10, Mike Toewsmwto...@gmail.com wrote: On 16 August 2010 13:41, Peterweb...@pl.net wrote: And theres something called mapserver which seems to be a complete service. Sounds heavy. MapServer is not so much a complete server, as just a simple CGI executable (about a megabyte in size). You only need to craft a MAP file, which is a tricky text file telling the layer source and how it is stylized. You can connect to most things, including MySQL[1] and Shapefiles. To get a PNG, you only need to POST a few parameters to the executable, and it sends you the image file back. You can also use it with MapScript for PHP or Python. There is lots of documentation[2] and even a book[3]. -Mike [1] http://mapserver.org/input/vector/mysql.html [2] http://mapserver.org/introduction.html [3] http://www.apress.com/book/view/1590594908 ___ Discuss mailing list Discuss@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/discuss ___ Discuss mailing list Discuss@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/discuss ___ Discuss mailing list Discuss@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/discuss
Re: [OSGeo-Discuss] Best tool, shapefile to png, web
On 16 August 2010 15:39, Peter web...@pl.net wrote: - open a http socket to a CGI eg Opps, my bad. MapServer operates in two modes: CGI and MapScript. It looks like you want to go into MapScript mode for your application. Available in almost all of the P languages: PHP, Perl and Python. #!/usr/bin/python import mapscript map = mapscript.mapObj(/home/mapdata/mymap.map) img = map.draw() img.save(/home/mapdata/mymap.png) Again, the MAP file is required, but you can probably template that somehow and use it in a temporary file for your script. -Mike ___ Discuss mailing list Discuss@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/discuss
Re: [OSGeo-Discuss] Best tool, shapefile to png, web
BTW, QGIS has mapserver export plugin that exports *.map file and at this time save your layers (e.g. shapefile, etc.) in various format (png, jpeg, agg, etc) and open your mapserver to see web map. Noli On 8/17/10, Mike Toews mwto...@gmail.com wrote: On 16 August 2010 15:39, Peter web...@pl.net wrote: - open a http socket to a CGI eg Opps, my bad. MapServer operates in two modes: CGI and MapScript. It looks like you want to go into MapScript mode for your application. Available in almost all of the P languages: PHP, Perl and Python. #!/usr/bin/python import mapscript map = mapscript.mapObj(/home/mapdata/mymap.map) img = map.draw() img.save(/home/mapdata/mymap.png) Again, the MAP file is required, but you can probably template that somehow and use it in a temporary file for your script. -Mike ___ Discuss mailing list Discuss@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/discuss ___ Discuss mailing list Discuss@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/discuss
Re: [OSGeo-Discuss] Best tool, shapefile to png, web
On Mon, 16 Aug 2010 20:41:41 -0700 Mike Toews mwto...@gmail.com wrote: On 16 August 2010 15:39, Peter web...@pl.net wrote: - open a http socket to a CGI eg Opps, my bad. MapServer operates in two modes: CGI and MapScript. It looks like you want to go into MapScript mode for your application. Available in almost all of the P languages: PHP, Perl and Python. #!/usr/bin/python import mapscript map = mapscript.mapObj(/home/mapdata/mymap.map) img = map.draw() img.save(/home/mapdata/mymap.png) Again, the MAP file is required, but you can probably template that somehow and use it in a temporary file for your script. Just to round out this suggestion, mapserver comes with an executble shp2img which does, I believe, exactly what the OP wants. You do indeed need the MAP file, (which can be made with QGIS, as someone mentioned) then you just run shp2img -m your *.map -o your image.png Should be a piece of cake. No books required ;-) -- Micha -Mike ___ Discuss mailing list Discuss@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/discuss This mail was received via Mail-SeCure System. ___ Discuss mailing list Discuss@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/discuss