[mapserver-users] Allowing users to draw polygons on MapServer maps

David Jantzen djantzen at ql2.com
Wed Jul 7 22:49:39 EDT 2010


Err, I thought I had it working.  I just realized that the data I see in my Javascript editor is pixel positioning not lat/long:

<path id="OpenLayers.Geometry.Polygon_239" d=" M 272.2026427256986,175.77014412882204 270.3901427256986,175.83264412882204 269.0776427256986,176.33264412882204 268.3901427256986,177.52014412882204 268.2651427256986,178.89514412882204 268.7651427256986,179.83264412882204 270.6401427256986,180.20764412882204 272.5776427256986,180.45764412882204 274.5151427256986,179.52014412882204 275.8276427256986,179.20764412882204 275.8276427256986,177.58264412882204 274.2651427256986,176.52014412882204 273.7026427256986,176.14514412882204 272.2026427256986,175.77014412882204 z" fill-rule="evenodd" fill="#ee9900" fill-opacity="0.4" stroke="#ee9900" stroke-opacity="1" stroke-width="1" stroke-linecap="round" stroke-linejoin="round" stroke-dasharray="none" pointer-events="visiblePainted" cursor="inherit"></path>

Could you please provide a code snippet whereby I could get the appropriate lat/long vertices for a polygon I just drew?  I was trying variations on "p=new OpenLayers.Geometry.Polygon(document.getElementById("OpenLayers.Geometry.Polygon_239").getAttribute('d'))"
But now I see I'm way off!

Thanks much,
David

On Jul 7, 2010, at 6:34 PM, Lime, Steve D (DNR) wrote:

> Take a look at FeatureServer (or perhaps the WFS-T support in GeoServer or Tiny WFS). Such tools would facilitate the writing of geometries
> to a data store (e.g. PostGIS) that MapServer could read from. Of course you could write your own tool to do that. We've used rails and serialized
> geometries to/from OpenLayers as WKT easy enough.
> 
> Steve
> ________________________________________
> From: mapserver-users-bounces at lists.osgeo.org [mapserver-users-bounces at lists.osgeo.org] On Behalf Of David Jantzen [djantzen at ql2.com]
> Sent: Wednesday, July 07, 2010 6:13 PM
> To: mapserver-users at lists.osgeo.org
> Subject: Re: [mapserver-users] Allowing users to draw polygons on MapServer     maps
> 
> Hmm, this looks close to what I want:
> 
> http://openlayers.org/dev/examples/draw-feature.html
> 
> Any idea how I would export the polygons to a shapefile/database? What about loading them from a previous session?
> 
> Thanks,
> David
> 
> On Jul 7, 2010, at 2:50 PM, <christopher.schmidt at nokia.com> <christopher.schmidt at nokia.com> wrote:
> 
>> 
>> On Jul 7, 2010, at 5:19 PM, ext David Jantzen wrote:
>> 
>>> Hi All,
>>> 
>>> I've never used MapServer before, so this is definitely a newbie question.  I've read a bunch of the documentation and FAQ, but I haven't yet found a clear answer to this question:
>>> 
>>> Can I use MapServer to host a map, on which my clients can draw polygons and export them as shapefiles or into a database?  If not, is there another (open source) product that can?
>>> 
>>> Seems like one of the scripting toolkits could do this, but not without significant custom front end work.
>> 
>> I think this is approximately accurate. Personally, I would probably use
>> GeoDjango/OpenLayers for this kind of task.
>> 
>> Regards,
>> --
>> Christopher Schmidt
>> Nokia
>> 
> 
> _______________________________________________
> 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