[postgis-users] RV: Insert point in postgis

chodgson at refractions.net chodgson at refractions.net
Thu May 29 14:30:14 PDT 2003


You probably need to use php-mapscript to do this, but it's not very hard to do.

Use an image-map in an html form to capture the coordinates of the click inside 
of the map image. Do a little bit of math using the image size and the map 
extents to calculate the map coordinates of the click, and then insert those 
coordinates, along with the related data (name, address, etc) into the database 
using an SQl query in PHP.

There are examples of SQL for inserting a geometry into the PostGIS manual at
http://postgis.refractions.net/docs/x398.html#AEN401

Examples of the WKT for a point are at:
http://postgis.refractions.net/docs/c282.html

Have a go at it!

Chris

Quoting Luz Brigitte <luzbrigitte at hotmail.com>:

> I´m sorry, maybe that I don´t explain well.
> 
> The idea is to know like  I can insert a point in an application of
> mapserver and that inmediately with this information modifies my
> postgres database.
> 
> Or somebody knows anyone code lines php in which I request the
> coordinates x,y and in addition she captures information on that point
> in my database, for example : name, address, phone, etc.
> 
> 
> Brigitte P.
> Colombia
> 
> ------------------------------------------------------------------------
> ------------------------------------------
> I am not sure what two actions you are referring to.
> 
> What needs to happen in mapserver? Mapserver only display the data for
> your
> map. I assume the data for your map is stored in a table in PostGIS, so
> if you
> insert a new point into your PostGIS table, it will be displayed by
> mapserver.
> What else do you what to happen at the same time? If you want to insert
> other
> data into PostGIS at the same time (perhaps a row into another,
> non-spatial
> table) then you can use SQL transactions to do so - look them up in the
> PostgreSQL documentation.
> 
> Chris
> --------------------------------------
> Quoting Luz Brigitte <
> <http://lw12fd.law12.hotmail.msn.com/cgi-bin/compose?curmbox=F000000001&
> a=da28bbaf5a0f184d9fac6c11d1d66787&mailto=1&to=luzbrigitte at hotmail.com&m
> sg=MSG1054234822.57&start=1105925&len=17577&src=&type=x>
> luzbrigitte at hotmail.com>:
> 
> > Hi, somebody knows like I can insert a point within a map in mapserv
> and
> > that of once this is added to a table in postgresql.
> >
> > For example I have a customer´s map and I want add a customer but I
> need
> > both of this actions to occurr in tandem (Mapserv and Postgis).
> >
> > I work with mapscript - php in Mapserver 3.6 and PostgreSQL 7.2.2 and
> > postgis 0.6.3.
> >
> > Thanks a lot for your help.
> >
> >
> > Brigitte P.
> > Colombia
> 
> 







More information about the postgis-users mailing list