sketchucation logo sketchucation
    • Login
    🤑 SketchPlus 1.3 | 44 Tools for $15 until June 20th Buy Now

    GPS coordinates

    Scheduled Pinned Locked Moved Developers' Forum
    3 Posts 3 Posters 1.3k Views 3 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • B Offline
      Buildermax
      last edited by

      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

      Just love SU

      1 Reply Last reply Reply Quote 0
      • TIGT Online
        TIG Moderator
        last edited by

        @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_s into 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 as swa.rb file]
        It returns lat/long of any point, but you will need to tweak the code to get the latlong of ipoint=Geom::Point3d.new(instance.transformation[12],instance.transformation[13],instance.transformation[14])

        TIG

        1 Reply Last reply Reply Quote 0
        • thomthomT Offline
          thomthom
          last edited by

          I'm moving this thread to the Developer Section.

          Thomas Thomassen — SketchUp Monkey & Coding addict
          List of my plugins and link to the CookieWare fund

          1 Reply Last reply Reply Quote 0
          • 1 / 1
          • First post
            Last post
          Buy SketchPlus
          Buy SUbD
          Buy WrapR
          Buy eBook
          Buy Modelur
          Buy Vertex Tools
          Buy SketchCuisine
          Buy FormFonts

          Advertisement