GoMexSI / gomexsi-web

Explore Species Interactions in Gulf of Mexico with the GoMexSI webapp
http://gomexsi.tamucc.edu
3 stars 2 forks source link

Show centroids of studies on spatial query map #85

Closed jsimons9 closed 8 years ago

jsimons9 commented 11 years ago

Now that we have 49 different sources of data it would be a good idea to have the centroids of these studies show up on the spatial query map so that someone does not do a query in a location with no data.

reedhewitt commented 8 years ago

I'm now working on the front-end part of this. Jorrit, is there a way to get all the data points from the Globi API (and maybe also get data points limited by taxonomy)?

As far as the user interface goes, I think it would be effective to cluster the points together depending on the zoom level of the map. The more zoomed out the map is, the more points will be grouped together. As you zoom in to a specific area, you will be able to see the individual points at a more granular level. (See https://github.com/googlemaps/js-marker-clusterer for example.)

reedhewitt commented 8 years ago

In my local development environment I have the spatial query page updated to show centroids. I need to get with Jorrit and see about retrieving all the centroids for GoMexSI data only. Right now, I'm using the GloBI API to get all locations (using http://api.globalbioticinteractions.org/locations) and then filtering them down with a crude polygon of the gulf.

The initial page view shows all centroids as small red dots. After a search is made, the dots inside the search area turn green if they contained results or gray if they did not. (I experimented with clustering the dots, but that gets in the way of color coding, so I decided against it.)

A screenshot is attached. Jim, is this the kind of look you were hoping for?

spatial query map
jhpoelen commented 8 years ago

@reedhewitt looks pretty cool to me! Curious what Jim has to say about it.

jsimons9 commented 8 years ago

Yes, I like the way that is looking – much more informative as to where data are located. I assume that is GloBI thus some of the points are probably not GoMexSI points.

jim

From: Reed Hewitt [mailto:notifications@github.com] Sent: Friday, January 29, 2016 4:18 PM To: GoMexSI/gomexsi-web Cc: Simons, James Subject: Re: [gomexsi-web] Show centroids of studies on spatial query map (#85)

In my local development environment I have the spatial query page updated to show centroids. I need to get with Jorrit and see about retrieving all the centroids for GoMexSI data only. Right now, I'm using the GloBI API to get all locations (using http://api.globalbioticinteractions.org/locations) and then filtering them down with a crude polygon of the gulf.

The initial page view shows all centroids as small red dots. After a search is made, the dots inside the search area turn green if they contained results or gray if they did not. (I experimented with clustering the dots, but that gets in the way of color coding, so I decided against it.)

A screenshot is attached. Jim, is this the kind of look you were hoping for?

[spatial query map]https://cloud.githubusercontent.com/assets/957141/12689644/d1379f74-c6a3-11e5-9cdd-28f6b8659644.png

— Reply to this email directly or view it on GitHubhttps://github.com/GoMexSI/gomexsi-web/issues/85#issuecomment-176995167.

reedhewitt commented 8 years ago

@jhpoelen - is there a way to get the data from http://api.globalbioticinteractions.org/locations but limited to only GoMexSI?

jhpoelen commented 8 years ago

@reedhewitt not yet, but happy to add the functionality . . . how about something like http://api.globalbioticinteractions.org/locations?accordingTo=gomexsi ?

jhpoelen commented 8 years ago

@reedhewitt by the way, if you don't mind repeating locations and paging, you can use the existing api to requests lat/lng information using http://api.globalbioticinteractions.org/interaction?accordingTo=gomexsi&includeObservations=true&field=latitude&field=longitude&limit=10&offset=5 . Please let me know your preference.

reedhewitt commented 8 years ago

@jhpoelen That will work great. What's the difference between those two links? The second one is much shorter even when I remove the limit and offset parameters.

jhpoelen commented 8 years ago

the first link returns distinct locations, the second one returns the locations associated with individual interaction records. So, the former contains only unique lat/lng/depth combinations, and the latter may contain duplicates. Please do note that you'd have to page through the result for the second one, because the results are limited to 1024 results by default. This said, which method do you prefer?

reedhewitt commented 8 years ago

I think the first one would generally be better — no duplicates to resolve and no paging. Would the individual interaction records be equivalent to the lat/lng of the search results (the point you see when you go to a result and click on the "Map" link to view the centroid)?

jhpoelen commented 8 years ago

Ok. thanks for sharing your preference. I'll proceed to implement the http://api.globalbioticinteractions.org/locations?accordingTo=gomexsi functionality. And yes, the second method are simply a list of interactions where only the lat/lng params are retrieved. Will update this issue if the method is available. Thanks!

jhpoelen commented 8 years ago

@reedhewitt I've implemented the requested functionality: http://api.globalbioticinteractions.org/locations?accordingTo=gomexsi now returns only locations reported by GoMexSI. Please confirm by closing this issue.

reedhewitt commented 8 years ago

@jhpoelen Looks good to me!

reedhewitt commented 8 years ago

I'm seeing a lot of points that are not anywhere near the Gulf of Mexico. Is this expected behavior? If so, should I do something to filter out points that are not in the Gulf? (Previously, when I was using all GloBI locations, I set up a rough polygon of the gulf and filtered against that. Seemed to work fine from a technical standpoint, but I don't think my boundary should have the final say on what is in or not in the search results.)

screen shot 2016-02-09 at 8 26 29 pm
jhpoelen commented 8 years ago

@reedhewitt thanks for spotting this. It turned out to be a caching issue and it should be resolved now. Please confirm that now only locations in Gulf of Mexico are present.

reedhewitt commented 8 years ago

@jhpoelen Much improved! There are a handful of points along the east coast and one in Illinois, plus one in central Asia. I'm guessing those probably don't matter and won't affect the usability of the spatial query. Just thought it was interesting. When the map loads, it is zoomed in to the Gulf of Mexico, so people probably won't even notice if there are a few random points in other areas.

screen shot 2016-02-10 at 7 23 46 am screen shot 2016-02-10 at 7 23 18 am
jhpoelen commented 8 years ago

@reedhewitt thanks for sharing this information! More likely than not, these locations are data errors. Could you please create a separate bugs for this so that we can have a look at this? Details matter!

jsimons9 commented 8 years ago

Good point. Better to find out if they are bugs or mis-plotted points.

Jim

From: Jorrit Poelen [mailto:notifications@github.com] Sent: Wednesday, February 10, 2016 10:14 AM To: GoMexSI/gomexsi-web Cc: Simons, James Subject: Re: [gomexsi-web] Show centroids of studies on spatial query map (#85)

@reedhewitthttps://github.com/reedhewitt thanks for sharing this information! More likely than not, these locations are data errors. Could you please create a separate bugs for this so that we can have a look at this? Details matter!

— Reply to this email directly or view it on GitHubhttps://github.com/GoMexSI/gomexsi-web/issues/85#issuecomment-182452070.