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
Is there a way to draw concentric polygons/circles using large image? #289
Comments
Internally, polygons can be have holes. They can be specified like {"outer": [[5, 6, 0], [-17, 6, 0], [56, -45, 6]], "inner": [[[4, 5, 0], [2, 5, 0], [2, 1, 0]]]}, where the inner entry can have any number of lists, each of which is a separate hole. There currently isn't any user interface for drawing a hole in a polygon, and you can't currently edit a polygon with holes. From the user interface, how would you specify that you want to add a hole to a polygon? |
Yeah, I saw that the large_image documentation didn't mention anything about creating holes. I was looking at GeoJSON's documentation and they noted that the polygons could be specified with holes, like what you said: With holes:: { "type": "Polygon", I was kind of hoping I would be able to add a list of more points underneath the "points" header below to put holes in my polygon, but as you said I don't think that's possible in large_image: Thanks for the help though. |
I've add OpenGeoscience/geojs#845 to eventually support this. |
Had another question on this...is it possible to install the Geospatial plugin in Girder and be able to make GeoJSON formatted query statements in the web API (rather than using large_image formatted statements)? I ask because the Geospatial plugin says it "enables the storage and querying of GeoJSON formatted geospatial data" so does this mean I can switch from: large_image format: to GeoJSON format: I know you said there's no interface to support hole generation, and this didn't work when I tried it, but just wondering if this was still an option. |
The geospatial and large_image plugins use different data storage locations and types. The large_image annotations are stored in a distinct Mongo collection (actually two collections: annotation and annotationelement). The data in large_image annotations are their own schema which includes element types that don't exist in GeoJSON. The Girder geospatial plugin handles GeoJSON data stored in a 'geo' field in the item collection, and searches only within that field. |
@rwtam121 You would see the geospatial endpoints under "item" since that plugin is adding new routes to items. Just expand the item endpoints. |
@dorukozturk Thanks for pointing me in the right direction! Sorry to keep moving off topic but I tried putting some geoJSON known to work in the geojson.io website (gets a square as seen in the below left): and I went back to the REST API and put that json onto the image using PUT/item/{id}/geospatial. But I got this error (TypeError: String indices must be integers): The field looks like it contains valid GeoJSON (it worked within geojson.io) so I am missing something fundamental here--should I use PUT/item/{id}/geospatial to put the overlay on the items? Thanks for the help! |
Sure, no problem. I think you only need the geometry part. Try it with the geometry portion of it. Something like: {
"type": "Polygon",
"coordinates": [
[
[
-86.484375,
23.885837699862005
],
[
-73.47656249999999,
23.885837699862005
],
[
-73.47656249999999,
31.052933985705163
],
[
-86.484375,
31.052933985705163
],
[
-86.484375,
23.885837699862005
]
]
]
} |
Hmmm, I still got the same error when doing that: |
Hi @dorukozturk , I was able to get the geospatial info from the coordinates with the help of girder/girder#2744, using PUT /item/{id}/geospatial. But this just sets the geospatial info for the object: I'm wondering we could translate that geospatial info into an overlay on top of that item, much like in the annotations case. Is that currently supported? I scanned the REST API and I don't think we can translate the geospatial info into an annotation. |
I am afraid that is currently not supported. At least I don't know an easy way to go about that. |
Circle annotations are supported. Polygon annotations with holes are supported. Nested circles have to be specified as polygons with holes. |
Hi,
I was looking at the annotations documentation here: https://github.com/girder/large_image/blob/master/docs/annotations.md and was wondering if we could create a single polygon or a circle that has a polygon/circle within it. I ask because the nature of the annotations seems that if you put the points into the points array, a line will be drawn connecting the inner circle/polygon to the outer circle/polygon, like this:
From documentation the points are specified like this:
"points": [
[5,6,0],
[-17,6,0],
[56,-45,6]
]
But is there any special way for it to support concentric polygons without a connecting line?
The text was updated successfully, but these errors were encountered: