[Mapserver-users] Adding Data

Antti.Roppola at brs.gov.au Antti.Roppola at brs.gov.au
Mon May 24 18:54:55 PDT 2004


Storing a single point is easy. Queries already depend on being
able to translate a click to map coordinates, you then just use
a web form to stuff the point (and any desired attribute data)
into a database of your choice. In this case Postgres/PostGIS via PHP:

	$date = date("Y-m-d");
	$sql="INSERT INTO sites (site_id, site_type, date_reported,
		report_contact, sites_geom) VALUES";
	$sql=$sql . " (1, '$site_type', DATE '$date', '$report_contact',
		GeometryFromText('POINT($x_coord $y_coord)', -1))";

Stringing a bunch together as a polygon (without going back to the
server for each vertex) is a bit more involved. You need/want to be able
to collect a series of points in the browser and submit them at once,
aka some kind of in-browser drawing tool. Shockwave/Flash is the neatest
looking solution I have seen in this regard (the apps are reasonably small,
perform well and seem to run correctly on most browsers). I have also seen
an application that used a proprietary Java Applet (to let farmers digitise
their fields). I am sure that there are suitable drawing tools out there
that could be used with minimal modification.

Cheers,

Antti

-----Original Message-----
From: Eric Bridger [mailto:eric at gomoos.org]
Sent: Tuesday, 25 May 2004 6:30 AM
To: Eric Katherman
Cc: Mapserver List
Subject: Re: [Mapserver-users] Adding Data


On Mon, 2004-05-24 at 15:17, Eric Katherman wrote:
> What would be the best way to "add data" to a mapset... I would like to be 
> able to click on a given map.. have it store the points I am clicking and 
> when done connect them as a filled polygon with some other tag data 
> associated with it... would like to store all of this in MySQL.  What is the 
> best place to start.

You will need to use mapscript, vs. CGI mapserver, to accomplish what
you describe. So step one would be to chose your favorite flavor:
Python, PHP, Perl, etc. and get it installed.  Then there are examples
for the various flavors in the Mapserver Wiki for translating a map
click into a lat/long point, creating lines and polygons as shapes, etc.
I'm not sure what the current status of MySQL is regarding storing such
geometries. Postgres with PostGIS could store your geometries along with
your tag data.

HTH.


_______________________________________________
Mapserver-users mailing list
Mapserver-users at lists.gis.umn.edu
http://lists.gis.umn.edu/mailman/listinfo/mapserver-users



More information about the MapServer-users mailing list