Function latlong_to_point gives unexpected results

I’ve got a georeferenced model and I want to import some data into it. The data comes from OpenStreetMap and contains lat and lon coordinates, so I used Sketchup’s internal function model.latlong_to_point. But the resulting data were created 5 228 000 km far from origin, although they are in the same area as the model. Furthermore they were stretched in the north-south direction and flipped as shown in this image:

(Blue edges = imported data, other colors = original model)

.

I found this very strange, so I tried to test how the function works. This piece of code is supposed to give [0,0,0], because I use the model’s geolocation and feed it into the latlong_to_point function.

model = Sketchup.active_model
si = model.shadow_info
model.latlong_to_point [
  si["Latitude"],
  si["Longitude"]
]

.

But instead of

Point3d(0,0,0)

I get this:

Point3d(1.54736e+08, -1.35691e+08, 0)

.

Either I don’t get how to use the function or it’s broken :cry:

Ahaa!

The function is called latlong_to_point, but you have to pass long first, then lat!

Problem solved, never mind!

Yeah, someone wasn’t thinking clearly when they implemented that method!

My coordinates still aren’t coming in correctly. I think I found part of the issue which is that my Lat/Long are from an Australian source where the GDA94 system is standard, but Sketchup is using the WGS84 coordinate reference system.

Anyone know how to convert/align the two?

@alex.cheek This specific topic has been solved, please open a new topic here, or even better in the official API Issue Tracker at GitHub (since there are several datums missing from SketchUp’s API.) …