adding lat/long coordinates to the "code" field in geographic headings

138 views
Skip to first unread message

Creighton Barrett

unread,
Jul 20, 2016, 9:30:47 PM7/20/16
to ica-ato...@googlegroups.com
Hiya,

We have been experimenting with the geographic headings taxonomy and are now working on adding latitude and longitude coordinates to the "code" field for each heading in our AtoM site.

Our coordinates plot longitude as the X point and latitude as the Y point. I can see from adding a few coordinates to the code field that AtoM seems to expect latitude on the X point and longitude on the Y point.

Is there any reason why AtoM is configured this way? The Google Maps API expects longitude as the X point and latitude as the Y point. In order for us to achieve the desired static map, we have to "reverse" the coordinates. This produces the correct static map but it means the data would need to be manipulated if it were to be exported (which is our primary goal behind adding the coordinates to the AtoM database).

Any ideas? I see the docs for 2.3 indicate this field is still under development, so I just want to get a sense of how the field works before we proceed.

Thanks,
Creighton



Dan Gillean

unread,
Jul 21, 2016, 1:18:12 PM7/21/16
to ICA-AtoM Users
Hi Creighton,

Interesting... can you show me where you've found it listed that Google Maps API expect long,lat rather than lat,long? I couldn't find a definitive entry, but after glancing through some of the examples in the API documentation, I generally found latitude listed as X, and longitude as Y.

I should probably remove that line about the field being under development, unfortunately. We've had some serious interest, but in the end, so far no one has committed to sponsoring enhancements to term geolocation or the "Code" field. This field was introduced as a one-off, admittedly somewhat partially complete feature in a very early version on AtoM, and until 2.x was never even documented. In terms of what I can tell you about its functionality, you're correct that it seems to expect lat,long as the X,Y values. I have learned that degree/directional based coordinates (e.g. 49°12.4068′ N,122°54.6552′ W) no longer work as expected in the Static Map API included in AtoM - though they did at one time, so something in the API seems to have changed. I have also noticed that you can use also use address information and the API will do its best to match them (and using the form of the address that appears in Google Maps autocomplete seems to work best):



Beyond this, you know as much as I do - the developer who added this feature has long ago left Artefactual, and as I mentioned, this feature was never properly documented even when it was first added to a very early release, and it has unfortunately not been actively maintained or developed since that time.

We'd love to see this field renamed, and updated to use a Dynamic maps API. We've also previously prepared estimates that would allow administrators to enable a setting that would then include a dynamic map on linked descriptions with Place terms that have latitude and longitude data - where multiple place terms are included, pins would appear and the map zoomed out to show all related places, so there's not multiple maps in the Places access point area. Unfortunately the prospective client had other priorities and the development proposal has not been included on the upcoming roadmap - but contact me off list if you're interested in such development in the future.

I'll try to update the documentation with further information in the near future.

Regards,

Dan Gillean, MAS, MLIS
AtoM Program Manager
Artefactual Systems, Inc.
604-527-2056
@accesstomemory

--
You received this message because you are subscribed to the Google Groups "ICA-AtoM Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ica-atom-user...@googlegroups.com.
To post to this group, send email to ica-ato...@googlegroups.com.
Visit this group at https://groups.google.com/group/ica-atom-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/ica-atom-users/CAHueW_UzeukxuzzdpipH03282xRkkVfEkGEehgVxghqapf-Cig%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Creighton Barrett

unread,
Jul 22, 2016, 8:33:10 AM7/22/16
to ica-ato...@googlegroups.com
Hi Dan,

I didn't see it anywhere in the Google Maps API documentation, but when I put the coordinates in the other way, I was getting static map images that didn't make any sense. However, this could just be another one of our homegrown problems. And I think we have solved the problem! Which is not an AtoM problem, but I think it deserves an explanation here, in case it helps other users or developers who are tinkering with these fields or trying to geocode their place names.

After consulting with our GIS Centre (which helped us build the first version of our finding aids map using ESRI's ArcGIS Server), I now realize that it is entirely possible that the coordinates I received are just how the data is exported from ArcGIS Server and not necessarily representative of any kind of standard or best practice.

However, there are specifications outlined in ISO 6709:
  • Longitude has negative values west of the Prime Meridian and positive values east of the Prime Meridian
  • Latitude has negative values south of the equator and positive values north of the equator
  • Vertical coordinates (i.e., height or depth) are optional
  • "Coordinate reference system" (CRS) is optional
And this is where we got confused. For example, the coordinates for Aberdeen (Scotland) that I received from our GIS Centre (which helped us build the first version of our finding aids map using ESRI's ArcGIS Server) are:

-2.098138835240000,57.143687350199997

Aberdeen is slightly west of the Prime Meridian, so the X coordinate here is clearly the longitude and the Y coordinate is clearly the latitude.

But Google Maps says that this location is somewhere in the Indian Ocean: https://www.google.ca/maps/place/2%C2%B005'53.3%22S+57%C2%B008'37.3%22E/@-2.0981334,21.2843147,3z/data=!4m5!3m4!1s0x0:0x0!8m2!3d-2.0981388!4d57.1436874

Note that Google Maps converts lat/long coordinates into degree coordinates. But if I reverse the X and Y points I received, Google Maps will create the correct plot:

https://www.google.ca/maps/place/57%C2%B008'37.3%22N+2%C2%B005'53.3%22W/@57.1436903,-2.1068935,15z/data=!4m5!3m4!1s0x0:0x0!8m2!3d57.1436874!4d-2.0981388

So it now seems that AtoM, and Google Maps API, expect latitude on the X coordinate and longitude on the Y coordinate. One of the key statements about Google Maps in my first post is, thus, entirely wrong!

I suspect this is because Google Maps doesn't expect users to specify a CRS. According to ISO 6709 (as I have learned from https://en.wikipedia.org/wiki/ISO_6709), a CRS can specify the order of the items in a geographical point. Without a CRS, latitude should come before longitude.

I imagine that, in the ArcGIS Server environment where our finding aids map was created, there was some kind of CRS that specified that longitude should come first. This would explain why our CSV data has longitude on the X point and latitude on the Y point.

In any case, the X and Y coordinates we have are two columns in a CSV file that can easily be swapped when they are entered into the code field. It's not a big deal, but I was concerned about entering 1000+ coordinates into a field that was "under development." It would be terrible if a future release moved Aberdeen into the Indian Ocean!

Dan, this is probably way more than you ever wanted to know about lat/long coordinates (it's more than I wanted to know and I still have no idea what I'm talking about!) but I hope it helps if you decide to update the 2.3 documentation.

And thanks, as always, for looking into this closely and sending such helpful information.

Cheers,
Creighton

Dan Gillean

unread,
Jul 22, 2016, 10:12:03 AM7/22/16
to ICA-AtoM Users
Thanks for the helpful follow-up and clarification, Creighton! It will be useful to have this further context when updating the documentation. I'm glad we figured this out before you ended up generating a bunch of maps in the middle of the ocean!

One of the development proposals we had discussed was the possibility of adding separate lat and long fields to replace the existing code field, but ultimately we rejected this because we could not reliably migrate user data to the updated fields. Knowing that the field can accept addresses, for example, we would only consider additions (e.g. new fields as an option, with the code field kept intact) rather than replacements or changes to how the code field works, specifically to ensure that legacy user data is not negatively affected by any changes we might make. So don't worry - if you enter the data correctly now to generate the map you wish to see, we won't go changing it and rendering your data useless down the line!

Good luck! I'll try to update this thread when I've had a chance to review the documentation.

Cheers,

Dan Gillean, MAS, MLIS
AtoM Program Manager
Artefactual Systems, Inc.
604-527-2056
@accesstomemory

Creighton Barrett

unread,
Jul 22, 2016, 11:47:13 AM7/22/16
to ica-ato...@googlegroups.com
Thanks, Dan, that's good to know about the possible future updates. I think it's a good idea to keep latitude and longitude coordinates together, as comma-delimited values. The big GIS applications (Google Maps and ESRI's ArcGIS products) can accept the data that way, so there isn't any reason I can think of to tease the values apoart.

Thanks again!

Creighton

cl...@ecomp.poli.br

unread,
May 9, 2017, 8:48:47 AM5/9/17
to AtoM Users
Hello, guys!

I'm trying to setting the geolocation using google maps api, but it's not working. Searching for some related topic, I found here an example of an archival institution which has geolocation, the New Westminster institution, but when I go to the page of this institution, there's no map there. Is there any reason for this institution take out the maps of its page? 

Thanks a lot,

Carolina Melo

Dan Gillean

unread,
May 15, 2017, 12:18:25 PM5/15/17
to ICA-AtoM Users
Hi Carolina,

The instructions for configuring a dynamic Google map on the repository view page can be found here:

You'll need a Google Maps API key, and the value should be added to the config/app.yml file in version 2.3 and earlier (there will be a place you can add it in the user interface in 2.4). See:

Note that the # pound symbol on the line comments it out - make sure to remove this once you've added the key!

Remember as well that after editing the YAML file, you will need to clear the application cache and restart PHP-FPM. To clear the application cache:

  • php symfony cc

To restart PHP-FPM, it will depend on what version of Ubuntu you are running. In Ubuntu 14.04:

  • sudo service php5-fpm restart

In 16.04: 

  • sudo systemctl restart php7.0-fpm

For the map to work, you also need to have the latitude and longitude values added to the Contact area of the Archival institution. Note that there is also a command-line task you can run that will try to determine the lats and longs from the address information and add it to all institutions:

  • php symfony tools:find-repository-latlng

If you are trying to add a map to a place term, such as the New Westminster example that was shown in this thread, you need to add your lat/long data to the Code field of the term. See:

Note that previously, the Static Maps API supported any kind of lat/long data, however Google has changed this. You can no longer use cardinal GPS Coordinates (e.g. lats and longs listed with degrees and directionality). Instead you have to use the degree coordinates. (I'm not sure these are the correct technical terms for the different types of coordinates, but I will give an example of what I mean - New Westminster, BC:

  • Will work: 49.205718, -122.910956
  • Will no longer work: 49° 12' 20.5848'' N 122° 54' 39.4416'' W

I've noticed that our screenshot in the documentation on the terms page still shows cardinal GPS coordinates in the image - I'll have to update this at some point.

Finally, note that in version 2.4, you can also add latitude and longitude values to a digital object for some basic geolocation, and if you have a Maps API key added and the setting turned on, then AtoM will display a dynamic map in the digital object metadata area. Information on this ticket:

Let us know if this helps!


Dan Gillean, MAS, MLIS
AtoM Program Manager
Artefactual Systems, Inc.
604-527-2056
@accesstomemory

You received this message because you are subscribed to the Google Groups "AtoM Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ica-atom-users+unsubscribe@googlegroups.com.
To post to this group, send email to ica-atom-users@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages