Data Studio
5.6K members online now
5.6K members online now
Ask questions about Data Studio
Guide Me
star_border
Reply

latitude, longitude not recognized from postgres

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

So i have a column called coords. It is created as such:   

select lat || ',' || lon as coords from my_table;

however, data studio says it is not recognized for geo lat, lon

1 Expert replyverified_user

latitude, longitude not recognized from postgres

Google Employee
# 2
Google Employee

Hi Will,

 

Can you share a couple of examples of the data in that column? 

 

Rick

Re: latitude, longitude not recognized from postgres

[ Edited ]
Visitor ✭ ✭ ✭
# 3
Visitor ✭ ✭ ✭

Yup! Thanks!

 Screen Shot 2017-02-03 at 1.28.36 PM.png

 

 

latitude, longitude not recognized from postgres

Visitor ✭ ✭ ✭
# 4
Visitor ✭ ✭ ✭

it probably would just be easier to have 2 data types in geo: latitude and longitude (separately) (look at tableau for reference)

latitude, longitude not recognized from postgres

Google Employee
# 5
Google Employee

Hi Will,

 

I believe the combined Lat,Long format is a legacy from Google Analytics (that's how coordinates come from GA). So separating them into 2 fields would break GA data sources.

 

As for your issue, are you getting an error message when you set the data type to Geo > Lat Long in the data source? If you ignore that, can you use the Coords field in a Geo Chart?

 

Just using your data in Google Sheets, I get that warning, but the field works fine. I'll look into why the warning is shown, but your data looks ok from here.

 

Rick

latitude, longitude not recognized from postgres

Visitor ✭ ✭ ✭
# 6
Visitor ✭ ✭ ✭

makes sense. This is feeding straight from postgres. If i continue beyond the error message it still doesn't show on the geo chart. 

 

Any ideas about what I can try next?

 

maybe it has something to do with merging the columns?

lat is a double, lon is a double (in postgres)

select lat || ',' || lon as coords from x makes coords a string no?

 

I did notice when I export to csv, the comma in the field is misinterpreted as a headless column

latitude, longitude not recognized from postgres

Visitor ✭ ✭ ✭
# 7
Visitor ✭ ✭ ✭

Hi Rick, thanks for the help. Any updates on this?   Also, is there a filter for the map? For example if i link a state dropdown, can the map zoom to that state?

Re: latitude, longitude not recognized from postgres

Google Employee
# 8
Google Employee

Hi Will

 

Sorry, I missed your previous message. 

 

You do need to set the semantic Type of the LatLong dimension to "Latitude, Longitude" or the geo chart won't be able to recognize it. (But I thought you were already doing that?). 

 

I'm not exactly sure what you mean by exporting to csv (from PostgreSQL?), but yes, a comma will create a new column. You need to surround the values with quotes to prevent that...)

 

You can set up a filter control on a geo dimension and that will filter the data in the map, but it won't change the zoom level. (That would be cool though).

 

Screen Shot 2017-02-10 at 9.59.48 AM.png

Best regards,

 

Rick