[postgis-users] Google Polyline into PostGIS

James David Smith james.david.smith at gmail.com
Mon Feb 18 01:38:05 PST 2013


Hi David,

Thanks, will look into this too.

James




On 16 February 2013 17:43, David Quinn <daithiquinn at gmail.com> wrote:
> Hi James,
>
> I think you can do this if you decode the polyline into lat/longs using this
> https://developers.google.com/maps/documentation/utilities/polylineutility
> and then parse them into lat/long pairs. Then, you can insert geometries
> into your table using something like this:
> ST_GeomFromText('LINESTRING(20 30, 21, 30)')
>
> As an aside, I would check if this is allowed within the terms of use of
> Google.
>
> -David
>
> On Sat, Feb 16, 2013 at 2:16 PM, Richard Greenwood
> <richard.greenwood at gmail.com> wrote:
>>
>>
>>
>> On Fri, Feb 15, 2013 at 6:44 AM, James David Smith
>> <james.david.smith at gmail.com> wrote:
>>>
>>> Dear all,
>>>
>>> I've had a quick search online and found a few people who have had
>>> similar questions, but no definite answers. My question is whether
>>> there is a simple way to take an encoded Google Polyline and place it
>>> into a Geometry column of type Polyline within PostGIS (that PostGIS
>>> understands and can work with).
>>>
>>> By way of background, I am using the Google Directions API to generate
>>> some routes, and I want to store the results in a PostGIS database.
>>
>>
>> I do not know what a "encoded Google Polyline" is but I believe Google can
>> output KML. ogr2ogr can read KML and write to postgis, so that's where I
>> would start.
>>
>> Rich
>>
>> --
>> Richard Greenwood
>> richard.greenwood at gmail.com
>> www.greenwoodmap.com
>>
>> _______________________________________________
>> postgis-users mailing list
>> postgis-users at lists.osgeo.org
>> http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users
>>
>
>
> _______________________________________________
> postgis-users mailing list
> postgis-users at lists.osgeo.org
> http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users
>


On 16 February 2013 17:43, David Quinn <daithiquinn at gmail.com> wrote:
> Hi James,
>
> I think you can do this if you decode the polyline into lat/longs using this
> https://developers.google.com/maps/documentation/utilities/polylineutility
> and then parse them into lat/long pairs. Then, you can insert geometries
> into your table using something like this:
> ST_GeomFromText('LINESTRING(20 30, 21, 30)')
>
> As an aside, I would check if this is allowed within the terms of use of
> Google.
>
> -David
>
> On Sat, Feb 16, 2013 at 2:16 PM, Richard Greenwood
> <richard.greenwood at gmail.com> wrote:
>>
>>
>>
>> On Fri, Feb 15, 2013 at 6:44 AM, James David Smith
>> <james.david.smith at gmail.com> wrote:
>>>
>>> Dear all,
>>>
>>> I've had a quick search online and found a few people who have had
>>> similar questions, but no definite answers. My question is whether
>>> there is a simple way to take an encoded Google Polyline and place it
>>> into a Geometry column of type Polyline within PostGIS (that PostGIS
>>> understands and can work with).
>>>
>>> By way of background, I am using the Google Directions API to generate
>>> some routes, and I want to store the results in a PostGIS database.
>>
>>
>> I do not know what a "encoded Google Polyline" is but I believe Google can
>> output KML. ogr2ogr can read KML and write to postgis, so that's where I
>> would start.
>>
>> Rich
>>
>> --
>> Richard Greenwood
>> richard.greenwood at gmail.com
>> www.greenwoodmap.com
>>
>> _______________________________________________
>> postgis-users mailing list
>> postgis-users at lists.osgeo.org
>> http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users
>>
>
>
> _______________________________________________
> postgis-users mailing list
> postgis-users at lists.osgeo.org
> http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users
>


More information about the postgis-users mailing list