[postgis-users] Unprojected lat/long to 3081?

Francis Markham fmarkham at gmail.com
Thu Feb 3 17:24:00 PST 2011


EPSG 3081 is a metre projection, so you need to transform your points from
lat long into the appropriate projection.  Try something like this:

*UPDATE event_table*
*SET the_geom = ST_Transform(ST_SetSRID(ST_Point(event_location[1],
event_location[0]), 4326), 3081)
*


This assumes your input latlons use the WGS84 datum.

Cheers,

Francis

On 4 February 2011 09:33, Aren Cambre <aren at arencambre.com> wrote:

> I have a database containing a Postgres native point data type *event*that has the latitude and longitude for certain events. An example value of
> *event* is *(32.7748777996749,-96.7680574022233)*. Note: this is *not* a
> PostGIS data type. It's a native Postgres type.
>
> I tried to convert this into a PostGIS gemoetry field *the_geom* and
> project into 3081 at the same time using this:
>
> *UPDATE event_table*
> *SET the_geom = ST_SetSRID(ST_Point(event_location[1], event_location[0]),
> 3081)*
>
> (This derived from the example at
> http://postgis.refractions.net/docs/ST_Point.html and reinforced by some
> Google searching.)
>
> The problem is when I import this layer into a QGIS project with several
> 3081-projected layers, all of my event points are ending up in the Pacific
> Ocean just off Mexico's west coast. 3081 is a projection for Texas, and
> that's where all my other data is.
>
> Am I doing something wrong with the conversion? I assumed that there really
> is not a projection *per se* because the input is pure lat/long?
>
> Aren
>
> _______________________________________________
> 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/20110204/3e571929/attachment.html>


More information about the postgis-users mailing list