-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add google geocode lookup/create/edit as github/npm component importable into cwrc-writer entity dialogs #11
Comments
So, as far as I can tell, looking at this today, the Google Geocoding Service is meant to be used with Google Maps. From https://developers.google.com/maps/documentation/geocoding/start : "Geocoding is the process of converting addresses (like "1600 Amphitheatre Parkway, Mountain View, CA") into geographic coordinates (like latitude 37.423021 and longitude -122.083739), which you can use to place markers or position the map." The Geocoding also returns a Google ‘place id’ (https://developers.google.com/places/place-id), which is not, however, a URI. Form that site, "Place IDs uniquely identify a place in the Google Places database and on Google Maps” A place id looks like: ChIJPar2cpiILIgR3Nn4G5_bzDo. I’m happy for someone else to tell me if I’m looking at the wrong site, or have overlooked something. |
I believe the version of GeoCode installed in the old CWRC-Writer lookups was searching for the address (it had search suggestion / autocomplete) enabled and no disambiguation box. Can we go with that set up here? |
I don’t know how that geocode lookup was being used by the old lookups, because the result that comes back from geocode doesn’t have a uri. It’s got lat/long and a google place id. My best guess is that the google place id was being used. But, again, that is an id like this:
<place_id>ChIJF5T6z--FLIgRZ267H-MlPUU</place_id>
We can’t simply stick that into the ref attribute of an entity tag, because it would a be meaningless string. We would have to say that it is a google id. But that would take a lot of change to the tagging code, and to the entity lookups.
We could alternatively turn that id into a url, as described here:
https://developers.google.com/places/web-service/details
So, like:
https://maps.googleapis.com/maps/api/place/details/json?placeid=ChIJN1t_tDeuEmsRUsoyG83frY4&key=YOUR_API_KEY
which returns info about the place. But, as you can see, an api key is needed, so again using that url doesn’t seem all that useful.
Can we talk to whoever created that geocode lookup for CWRC?
For reference, here is what is returned from geocode (using the uri from the old CWRC dialogs code) for a query on ‘guelph’:
http://maps.googleapis.com/maps/api/geocode/xml?address=guelph
<GeocodeResponse>
<status>OK</status>
<result>
<type>locality</type>
<type>political</type>
<formatted_address>Guelph, ON, Canada</formatted_address>
<address_component>
<long_name>Guelph</long_name>
<short_name>Guelph</short_name>
<type>locality</type>
<type>political</type>
</address_component>
<address_component>
<long_name>Wellington County</long_name>
<short_name>Wellington County</short_name>
<type>administrative_area_level_2</type>
<type>political</type>
</address_component>
<address_component>
<long_name>Ontario</long_name>
<short_name>ON</short_name>
<type>administrative_area_level_1</type>
<type>political</type>
</address_component>
<address_component>
<long_name>Canada</long_name>
<short_name>CA</short_name>
<type>country</type>
<type>political</type>
</address_component>
<geometry>
<location>
<lat>43.5448048</lat>
<lng>-80.2481666</lng>
</location>
<location_type>APPROXIMATE</location_type>
<viewport>
<southwest>
<lat>43.4738450</lat>
<lng>-80.3269451</lng>
</southwest>
<northeast>
<lat>43.5950210</lat>
<lng>-80.1533910</lng>
</northeast>
</viewport>
<bounds>
<southwest>
<lat>43.4738450</lat>
<lng>-80.3269451</lng>
</southwest>
<northeast>
<lat>43.5950210</lat>
<lng>-80.1533910</lng>
</northeast>
</bounds>
</geometry>
<place_id>ChIJa_upw9CaK4gRYBsjxyh7AwU</place_id>
</result>
</GeocodeResponse>
… On Feb 12, 2018, at 1:17 PM, Mihaela Ilovan ***@***.***> wrote:
I believe the version of GeoCode installed in the old CWRC-Writer lookups was searching for the address (it had search suggestion / autocomplete) enabled and no disambiguation box. Can we go with that set up here?
—
You are receiving this because you were assigned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
With more digging into the old code, I see that it was taking the ‘formatted_address’ and sticking it onto the end of:
https://www.google.ca/maps/place/
So, for the guelph example, the entity lookup would return a URI like this:
If you go to that url you will see that it opens a google maps page for Guelph.
This seems a bit brittle. If Google ever changes what they resolve for the given formatted address (which they might well - I can’t imagine that they guarantee in perpetuity what’s returned for a formatted address string, whereas they might for their placeId) then the URI breaks.
james
… On Feb 12, 2018, at 1:38 PM, James Chartrand ***@***.***> wrote:
I don’t know how that geocode lookup was being used by the old lookups, because the result that comes back from geocode doesn’t have a uri. It’s got lat/long and a google place id. My best guess is that the google place id was being used. But, again, that is an id like this:
<place_id>ChIJF5T6z--FLIgRZ267H-MlPUU</place_id>
We can’t simply stick that into the ref attribute of an entity tag, because it would a be meaningless string. We would have to say that it is a google id. But that would take a lot of change to the tagging code, and to the entity lookups.
We could alternatively turn that id into a url, as described here:
https://developers.google.com/places/web-service/details
So, like:
https://maps.googleapis.com/maps/api/place/details/json?placeid=ChIJN1t_tDeuEmsRUsoyG83frY4&key=YOUR_API_KEY
which returns info about the place. But, as you can see, an api key is needed, so again using that url doesn’t seem all that useful.
Can we talk to whoever created that geocode lookup for CWRC?
For reference, here is what is returned from geocode (using the uri from the old CWRC dialogs code) for a query on ‘guelph’:
http://maps.googleapis.com/maps/api/geocode/xml?address=guelph
<GeocodeResponse>
<status>OK</status>
<result>
<type>locality</type>
<type>political</type>
<formatted_address>Guelph, ON, Canada</formatted_address>
<address_component>
<long_name>Guelph</long_name>
<short_name>Guelph</short_name>
<type>locality</type>
<type>political</type>
</address_component>
<address_component>
<long_name>Wellington County</long_name>
<short_name>Wellington County</short_name>
<type>administrative_area_level_2</type>
<type>political</type>
</address_component>
<address_component>
<long_name>Ontario</long_name>
<short_name>ON</short_name>
<type>administrative_area_level_1</type>
<type>political</type>
</address_component>
<address_component>
<long_name>Canada</long_name>
<short_name>CA</short_name>
<type>country</type>
<type>political</type>
</address_component>
<geometry>
<location>
<lat>43.5448048</lat>
<lng>-80.2481666</lng>
</location>
<location_type>APPROXIMATE</location_type>
<viewport>
<southwest>
<lat>43.4738450</lat>
<lng>-80.3269451</lng>
</southwest>
<northeast>
<lat>43.5950210</lat>
<lng>-80.1533910</lng>
</northeast>
</viewport>
<bounds>
<southwest>
<lat>43.4738450</lat>
<lng>-80.3269451</lng>
</southwest>
<northeast>
<lat>43.5950210</lat>
<lng>-80.1533910</lng>
</northeast>
</bounds>
</geometry>
<place_id>ChIJa_upw9CaK4gRYBsjxyh7AwU</place_id>
</result>
</GeocodeResponse>
> On Feb 12, 2018, at 1:17 PM, Mihaela Ilovan ***@***.***> wrote:
>
> I believe the version of GeoCode installed in the old CWRC-Writer lookups was searching for the address (it had search suggestion / autocomplete) enabled and no disambiguation box. Can we go with that set up here?
>
> —
> You are receiving this because you were assigned.
> Reply to this email directly, view it on GitHub, or mute the thread.
>
|
It looks like the option described by them is more likely to stay consistent:
So if I get this straight, we should be able to use that URL within CWRC, but if someone else wanted to use it in a different context, they would need to provide their own API key? (apologies if I am being dense here) |
On Feb 12, 2018, at 2:02 PM, Mihaela Ilovan ***@***.***> wrote:
It looks like the option described by them is more likely to stay consistent:
So, like:
https://maps.googleapis.com/maps/api/place/details/json?placeid=ChIJN1t_tDeuEmsRUsoyG83frY4&key=YOUR_API_KEY <https://maps.googleapis.com/maps/api/place/details/json?placeid=ChIJN1t_tDeuEmsRUsoyG83frY4&key=YOUR_API_KEY>
which returns info about the place. But, as you can see, an api key is needed, so again using that url doesn’t seem all that useful.
So if I get this straight, we should be able to use that URL within CWRC, but if someone else wanted to use it in a different context, they would need to provide their own API key? (apologies if I am being dense here)
Yes, they would have to provide their own key, which would be totally confusing for someone coming along later and seeing this URI out of the CWRC context, in a TEI doc that might have at some point been edited with the CWRC-Writer, but is now being viewed in something like Oxygen.
More importantly, if the point of someone using these place lookups is to add a URI to the ref attribute of a place entity - to uniquely identity that place using a shared identifier - this doesn’t do it. This URI doesn’t uniquely identify the place using an identifier that can be shared with others. It’s not an identifier. It’s a browser link.
… —
You are receiving this because you were assigned.
Reply to this email directly, view it on GitHub <#11 (comment)>, or mute the thread <https:/notifications/unsubscribe-auth/AAhZXUWwGMU2bsSjR0JOYZdrlCeyclIkks5tUIqugaJpZM4PBjcM>.
|
Hm, I get it now why Michael and Jeff decided in the past to go with https://www.google.ca/maps/place/Guelph,ON,Canada, even if this is also not-technically-an -identifiers, also. I think @SusanBrown should probably weigh in here as well. |
I’m not sure this was Michael and Jeff. I thought this code was developed by someone else.
… On Feb 12, 2018, at 2:24 PM, Mihaela Ilovan ***@***.***> wrote:
Hm, I get it now why Michael and Jeff decided in the past to go with https://www.google.ca/maps/place/Guelph,ON,Canada <https://www.google.ca/maps/place/Guelph,ON,Canada>, even if this is also not-technically-an -identifiers, also.
I think @SusanBrown <https:/susanbrown> should probably weigh in here as well.
—
You are receiving this because you were assigned.
Reply to this email directly, view it on GitHub <#11 (comment)>, or mute the thread <https:/notifications/unsubscribe-auth/AAhZXWphS7i7KHA0JvR2zyJgOamJKY8lks5tUI_sgaJpZM4PBjcM>.
|
It was initially developed by the Arts Resource Centre here at the UofA,
but after that Michael and Jeff spent some time on it as well.
On Mon, Feb 12, 2018 at 12:31 PM, James Chartrand <[email protected]>
wrote:
… I’m not sure this was Michael and Jeff. I thought this code was developed
by someone else.
> On Feb 12, 2018, at 2:24 PM, Mihaela Ilovan ***@***.***>
wrote:
>
> Hm, I get it now why Michael and Jeff decided in the past to go with
https://www.google.ca/maps/place/Guelph,ON,Canada <
https://www.google.ca/maps/place/Guelph,ON,Canada>, even if this is also
not-technically-an -identifiers, also.
>
> I think @SusanBrown <https:/susanbrown> should probably
weigh in here as well.
>
> —
> You are receiving this because you were assigned.
> Reply to this email directly, view it on GitHub <
#11#
issuecomment-365033534>, or mute the thread <https:/
notifications/unsubscribe-auth/AAhZXWphS7i7KHA0JvR2zyJgOamJKY
8lks5tUI_sgaJpZM4PBjcM>.
>
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#11 (comment)>,
or mute the thread
<https:/notifications/unsubscribe-auth/AGS1hiG4B44xCE1rX0DhMFApQferAtTjks5tUJGXgaJpZM4PBjcM>
.
--
Mihaela Ilovan
Project Manager
Canadian Writing Research Collaboratory
University of Alberta
4-20 Humanities Centre
Edmonton, AB
Canada T6G 2E5
780-966-4507
[email protected]
|
https://developers.google.com/maps/documentation/geocoding/intro
The text was updated successfully, but these errors were encountered: