[postgis-users] New to PostGIS question.

MarkW mark.wimer at gmail.com
Mon Jun 27 08:00:14 PDT 2011


Eric,
ST_AsText is one function you could use; then you could parse the list in
PHP, for example (you may have to add the schema prefix to your tablename)

    select name, field_code,
        trim(trailing ')))' from trim(leading 'MULTIPOLYGON(((' from
st_asText(the_geom)))
      as blockbounds
    from postgismethane
    where name = 'Bandini'

Mark

On Sun, Jun 26, 2011 at 8:00 PM, Eric Sepich <sepotovich at gmail.com> wrote:

> I exported a .shp full of polygons to my PostGIS enabled database. I think
> the data is in WKB (Well known binary format) but I am not sure yet.
> Attached is a screenshot. I need to write a query to return the first shape
> in the table and I need to be able to get the coordinates of the shape into
> an array. My language will be PHP to start out with. I have been reading the
> documentation but I really don't understand enough yet to really get
> started. Does anyone know readily how to do something like this?
>
> Thank you,
> Eric S.
>
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20110627/58c19c36/attachment.html>


More information about the postgis-users mailing list