users creating data

Jason Maestri jmaes at riparia.net
Wed Aug 2 18:16:29 EDT 2000


Andrea,
    We have played with this a little here at USU.  Mapserver cannot add
data to the shapefile triplets.  You'd
need to use shapelib and DBD::XBase or something for that.  We have
developed our own libraries for
editing shapefiles, they are in C++, right now, I just haven't had the
time to port them to Perl.  Maybe if there
is enough interest, we could post them in the public domain.  Esp. if
somebody wants to port them to perl.
    Anyway... The conclusion that we came to was that it was easy to add
points to a shapefile (description of
algorithm to follow) using only html, JavaScript and mapserver, but in
order to add line and polygon collections
comfortably, you'd need a java applet.  As far as just adding a point...
What we wound up doing (there's probably
a better way to do this.  Hopefully somebody else will comment, but this
was just a quick fix to get something
running, and we haven't bothered to change it) was to create a layer
with only one shape.  A square polygon which
was large enough to contain all of the other shapefiles.  This was drawn
transparently as the top layer (the user had
no clue it was there), and a query template was set up which captured
the coordinates of any click inside the
polygon.  Since it was on top, and it was bigger than everything else, a
click anywhere on the map would be inside
this polygon, and therefore would call it's query template.  The user
could then fill out a form on the query
template, adding any data the wanted in the shapefile, then they would
submit the form.  The CGI script would then
add a new point at the coordinates selected, and fill the database with
the data entered.
    The url for this application is:
http://riparia.riparia.net/teton/teton_init.html.  To add a new comment,
first turn on
the comments layer, then check the box next  to "add new comment".
Finally, set the mode to select, and click
away.  There are a bunch of comments on here from people playing with
it.  Nothing really useful yet... I'll clean it
up in about a week.
    Anyway  I hope this helps.  Sorry for the very long-winded answer.

--Jason Maestri

Andrea Goethals wrote:

> Hi.
>
> We have a project in which we want the user through
> a browser to be able to create data (probably shapefiles).
>
> I'm already using mapserver for another project, but
> haven't explored its capabilities enough to know if
> this is something it could do. The user would need
> to be able to draw new point, line and polygon datasets,
> and add attribute information to them.
>
> We also have been playing with ArcIMS for another project,
> and I don't even think the user can do that with ArcIMS.
> Even if they could though, it's way too expensive for
> this project.
>
> Does anyone have any suggestions?
>
> Thanks,
> Andrea
>
> @-------------------------@
> | Andrea Goethals         |
> | andreag at geoplan.ufl.edu |
> | GeoPlan Center          |
> | University of Florida   |
> | 431 Architecture Bldg   |
> | www.geoplan.ufl.edu     |
> | Gainesville, FL 32611   |
> | Phone: (352)392-2351    |
> | Fax:(352)392-3308       |
> @-------------------------@




More information about the mapserver-users mailing list