[postgis-users] RV: Insert point in postgis

Jeff Lounsbury jeffloun at refractions.net
Thu May 29 15:20:42 PDT 2003


I had done this a while ago, I have attached the files.
If you can dig through the php files, there is php-mapscript to add/view/query
points
As I recall you need to create a table in postGIS for the ones you are going to add
and I think I used a blank shape file that I programmatically added a point to just
to show the location on the map as you click somewhere before you confirm you want
to add that location to the db...
Also, I haven't sent any of the base data layers since they were fairly huge....
-Jeff

chodgson at refractions.net wrote:

> 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
> >
> >
>
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
-------------- next part --------------
A non-text attachment was scrubbed...
Name: point_map.tar.gz
Type: application/x-gzip
Size: 5019 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20030529/64912df1/attachment.bin>


More information about the postgis-users mailing list