geometry-api-java icon indicating copy to clipboard operation
geometry-api-java copied to clipboard

How to ask questions?

Open julianhyde opened this issue 7 years ago • 13 comments

I have just started using geometry-api-java in Apache Calcite and I have some questions. Is there a forum or mailing list to ask them? The contributing guidelines don't mention one.

julianhyde avatar Aug 25 '17 20:08 julianhyde

Feel free to ask questions right here.

alocke avatar Aug 25 '17 20:08 alocke

First of all, thanks for the library, and especially, thanks for making it Apache license.

Second, thanks for removing the json.org dependency. I'm working on Apache Calcite (see https://issues.apache.org/jira/browse/CALCITE-1968) and it was a non-starter without it. I'm developing on 1.2.1 but will have to upgrade to 2.0 before I release, due to those license issues.

Now the questions.

  1. Does GeometryEngine.geometryFromWkt support 3D? I get a parse error when parsing say "POINT(1 2 3)"; it expects to see ')' after '2'.

  2. Is there a way to include SRIDs in geometries? If so, how should I go about implementing ST_Transform?

  3. I notice that ESRI's union(point(1 2)) returns a MULTIPOINT, whereas PostGIS returns a POINT. Are both correct?

  4. Am I correct that buffer doesn't support style (endCap, join, quadSegs, mitreLimit).

That's it for now. But expect a few more as I work through this. :)

julianhyde avatar Aug 25 '17 21:08 julianhyde

  1. Yes. Use "POINT Z (1 2 3)".
  2. (Edited) Yes, a MapGeometry includes the spatial reference.
  3. Yes, both are correct.
  4. (Edited) That's right. Style is not supported.

Thanks for your interest. Looking forward to more questions and/or feedback.

alocke avatar Aug 25 '17 21:08 alocke

  1. Thanks - that worked.

  2. That worked too. I created a wrapper interface because neither Geometry nor MapGeometry is a sub-class of each other.

  3. Thanks. Will document in case people expecting PostGIS compatibility are surprised.

  4. I couldn't find class OperatorGraphicBuffer, either in 1.2.1 or 2.0-SNAPSHOT. I presume it's in the com.esri.core.geometry package?

julianhyde avatar Aug 28 '17 05:08 julianhyde

Sorry, I was wrong. OperatorGraphicBuffer isn't supported.

alocke avatar Aug 28 '17 16:08 alocke

No worries - 3 out of 4 is pretty good! (I'm keeping a list of missing functionality and will log issues when I get to the end of the current spike. I may find time to fix some of them, we'll see.) Now a couple more questions.

  1. How would you implement ST_Covers? I found ways to implement ST_Within and the similar relation operations, but not covers (and sadly, it's the hardest one!)

  2. You should consider adding a GeometryEngine.intersects method. OperatorIntersects works just fine, but unlike say OperatorWithin it didn't have a facade method.

  3. Is there a way to parse GEOMETRYCOLLECTION? GeometryEngine.geometryFromWkt doesn't seem to support it.

julianhyde avatar Aug 28 '17 23:08 julianhyde

  1. For ST_Covers, try using OperatorRelate with "*****FF". Although I am not 100% sure it is equivalent. See also here: https://en.wikipedia.org/wiki/DE-9IM.

  2. Use operators. They are a part of the public API. You can chain them if you use GeometryCursor methods.

  3. OGCGeometry classes may provide some rudimentary support. You should be able to import geometry collection using those.

stolstov avatar Aug 28 '17 23:08 stolstov

  1. No it's not "*****FF". It's a combination of 4 such patterns. I wasn't brave enough to do something so complicated.

  2. Yes, figured out how to use operators. It's just inconsistent that GeometryEngine has within, touches, overlaps, equals, crosses, disjoint, contains but not intersects.

  3. Thanks - will try that.

julianhyde avatar Aug 29 '17 00:08 julianhyde

Should be "*****FF *". Try this though. I cannot think of a case it violates for non-empty inputs.

stolstov avatar Aug 29 '17 00:08 stolstov

It keeps removing the last star...

stolstov avatar Aug 29 '17 00:08 stolstov

No doubt markdown tries to interpret asterix as emphasis.

randallwhitman avatar Aug 29 '17 00:08 randallwhitman

Note, I've added a space to workaround the removing the star character. The string should not contain any spaces.

stolstov avatar Aug 29 '17 00:08 stolstov

Write it as code with backtick. "******FF*"

alocke avatar Aug 29 '17 00:08 alocke