Open Eneroth3 opened 4 years ago
I've found two values representing the geo location height in "GeoReference" attribute directory, ModelTranslationZ and ZValueCentered. The former appears to be the one used when adding more imagery.
However, reading these values is of course a hack as it isn't documented API, and there is no guarantee whatsoever it will be the same in the future.
AFAIK, this dictionary is compliant with the Google Maps API. So I'd suggest checking there for documentation.
Not really sure how to scope this issue.
Right now I am interesting in getting the model geo location height, but there are other things that are useful in the long run.
When you geo-locate a model in SketchUp, the model origin isn't at sea level but intersects the terrain and gives you a reasonable 0 level for the project. However I can't find any official API for reading the model (origin) height over sea level. My use case now is to draw iso curves from a terrain mesh at even multiples above see level, not the project zero level, but this can be useful for determining flooding risks, maybe be useful for Sefaria's energy analysis, be used to position geo-localized point clouds and so much more. I'm quite surprised LatLogn and UTM conversion ignores the Z coordinate.
I've found two values representing the geo location height in "GeoReference" attribute directory, ModelTranslationZ and ZValueCentered. The former appears to be the one used when adding more imagery.
However, reading these values is of course a hack as it isn't documented API, and there is no guarantee whatsoever it will be the same in the future. An official method, e.g. on the Model class, would be useful for this.
When looking at the bigger picture I also think there should be setter methods for the model location (including height). If you for instance import a geo-located point cloud or import a DWG with a known exact location for its origin, I think SketchUp should allow for geo-locating the model to it. For already geo-located models such imports could be automatically positioned in its precise location.
Perhaps it is best to not add a height attribute to the Model class, but add a GeoLocation class that can wrap this as well as future functionality. On the other hand the Model class already has a lot of geo-location related methods that can't be moved for compatibility reasons.