Skip to content
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

error: value centroid is not a member of com.esri.core.geometry.Polygon #183

Open
bebertpalu opened this issue Jun 27, 2018 · 4 comments
Open
Labels

Comments

@bebertpalu
Copy link

Hi i am trying to use your library in spark shell environement but i have this error message:

:36: error: value centroid is not a member of com.esri.core.geometry.Polygon

My code :

spark-shell --master yarn --packages com.esri.geometry:esri-geometry-api:2.1.0

**import com.esri.core.geometry.Geometry
import com.esri.core.geometry.Polygon

val polygone = "POLYGON((4.745655459623948 46.03524426717903,4.745474046571832 46.035518174904055,4.74063090530349 46.04295685260622,4.739925882208126 46.044547519914246,4.739483609776077 46.04626745631142,4.739525128019815 46.047211663812355,4.739825175736136 46.048150103132244,4.740250385460172 46.04899654987392,4.741872451093781 46.05062714796118,4.743407686504395 46.05171953368259,4.747262145106063 46.053369755378974,4.751383858596383 46.055239098889565,4.753175276721485 46.05628146390567,4.755169011518056 46.05749901172311,4.75661821455738 46.05884025314148,4.757293283105074 46.05947830843228,4.758004296858232 46.06022839197492,4.758948494130379 46.061108160671,4.759081962267134 46.061195261252315,4.760737772227097 46.06061922955403,4.761719663784567 46.0601707369959,4.765096689865299 46.05832039797115,4.767379341111917 46.05732648395931,4.771955501771072 46.0555626231788,4.774437468314938 46.05469875488001,4.777836928008835 46.054085261406435,4.779689110155892 46.05215478789901,4.779868950123478 46.051835812485,4.780103563084089 46.05129079690939,4.781085536976064 46.04865878444159,4.781551741322944 46.04464325432172,4.775383402380884 46.04401133253986,4.774671046394766 46.04398195310052,4.77298489972034 46.043838098435366,4.7690157048809 46.04324888213076,4.768949645555281 46.04320577772445,4.768861191503296 46.04266762819899,4.767707575895149 46.040700441166436,4.765270854408862 46.03772010926994,4.759771208178281 46.03588709341677,4.755999294025783 46.035337603929165,4.750472322601267 46.03604097592636,4.745655459623948 46.03524426717903))"

val poly = OperatorImportFromWkt.local().execute(2,Geometry.Type.Polygon,polygone,null)**

// this last execution produce my error

poly.centroid

// do you think that librairy is not compatible with scala ?
// thank you for help

@stolstov
Copy link
Member

Here is how to do this:
Point2D centroid = OperatorCentroid2D.local().execute(polygone, null);

@randallwhitman
Copy link
Contributor

Centroid is added to master more recently than v2.1 of Geometry. Try building 2.2.0-SNAPSHOT in the meantime, then use v2.2.0 once released.
[Btw, I use the Geometry library from Scala, which works fine.]

@bebertpalu
Copy link
Author

ok thanks you

@randallwhitman randallwhitman changed the title error: value centroid is not a member of com.esri.core.geometry.Polygo error: value centroid is not a member of com.esri.core.geometry.Polygon Jun 29, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants