GPS coordinates
-
hi,
How can I get real world GPS coordinates [latitude, longitude] for multiple components’ origins after I have set the whole model’s global position and orientation?
thanks for your time in advance
-
@buildermax said:
How can I get real world GPS coordinates [latitude, longitude] for multiple components’ origins after I have set the whole model’s global position and orientation?
Type/Copy+Paste
puts "Latitude = \t"+Sketchup.active_model.shadow_info["Latitude"].to_s+"\n"+"Longitude = \t"+Sketchup.active_model.shadow_info["Longitude"].to_sinto the Ruby console to get the Model's Lat/Long...
Note this too...
latlong=Geom::LatLong.new([Sketchup.active_model.shadow_info["Latitude"],Sketchup.active_model.shadow_info["Longitude"]]) Sketchup.active_model.latlong_to_point(latlong)returns a point based on latlong
We want the inverse -point_to_latlong(point)
To find the equivalent latlong of a Group or Instance will be much more complex...
There has already been some work on this by John WS Hibbs see http://www.swajime.com/ruby/swa.txt [save it asswa.rbfile]
It returns lat/long of any point, but you will need to tweak the code to get the latlong ofipoint=Geom::Point3d.new(instance.transformation[12],instance.transformation[13],instance.transformation[14]) -
I'm moving this thread to the Developer Section.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register LoginAdvertisement