Subscribe to this thread
Home - General / All posts - Drawing from Query Question
dchall8
422 post(s)
#12-Apr-18 16:01

I can create the drawing from a query; however, the location of the new drawing is wrong.

I have a drawing of contour lines made from DEMs. The DEM and drawing are in NAD83 / UTM zone 14N (ESPG:26914) and are centered at roughly 98 west and 29 north. From the contour line drawing I selected the lines below the lake level and created a new drawing from the query. In the process I selected the same projection for the new drawing. The new drawing looks good but is centered at roughly 103 west and 0 south. I did a rough measurement of the size and the scale of the query drawing seems good. It just sits in the middle of the ocean west of the Galapagos Islands. What am I doing wrong? Also when I try to zoom to the new drawing, it does not go there. Is that because it is a drawing from query and not from a fixed table?

adamw


7,818 post(s)
online
#17-Apr-18 10:55

I would guess the coordinate systems aren't the same - one coordinate system has local scales / offsets and the other does not. You can check it by inspecting coordinate systems using dialogs in 9.0.166.4 (they are now selecting current coordinate system values when you open them, the values you want to check are in the Metrics readout at the bottom). If there is a difference, you can edit the coordinate system of the misregistered drawing to use the correct values. Alternatively, you can copy and paste the correct coordinate system from one drawing to another (locate the table / query for the correctly registered drawing, open properties, locate the coordinate system for the geom field, right-click and copy the value to the clipboard, close the dialog, locate the table / query for the incorrectly registered drawing, open properties, locate the coordinate system for the geom field, right-click and paste the value from the clipboard, click OK).

Also when I try to zoom to the new drawing, it does not go there. Is that because it is a drawing from query and not from a fixed table?

Yes. The query does not report the bounding box of the data it returns, because that bounding box is expensive to compute. We will adjust the map window to go ahead and compute the bounding box on its own.

dchall8
422 post(s)
#17-Apr-18 15:57

Copy and paste for coordinate systems.

Who came up with that idea? ...and where do I go to shake his or her hand?

Dimitri


4,754 post(s)
#17-Apr-18 20:10

It is cool and useful, (like copying/pasting Syle values), but keep in mind copy/pasting the JSON for the coordinate system is basically an "assign coordinate system" or "repair coordinate system". It is not a "change coordinate system."

Suppose Drawing A, created from Table A, has the correct coordinate system assigned, some version of Orthographic. Suppose Drawing B, created from Table B, is supposed to be using that exact same version of Orthographic, but instead it somehow got Latitude/Longitude or Pseudo-Mercator assigned, so now it doesn't show up where it should.

In the drawing's table, the FieldCoordSystem.Geom property gives the coordinate system to be used for the Geom field, if that's the name of your geometry field. So, if you want to have Drawing B use the same coordinate system as drawing A, just pop open Table A's properties, copy the value of the FieldCoordSystem.Geom property, and then pop open Table B's properties and paste that into the value of FieldCoordSystem.Geom property in Table B.

Now, suppose Drawing B uses Lat/Lon and it has had Lat/Lon correctly assigned as the coordinate system to be used. Drawing B shows up in the right place, etc. You want to re-project Drawing B from Lat/Lon into the same Orthographic used by Drawing A. To do that you have to use the Change Coordinate System dialog.

If you simply copy the JSON string out of the FieldCoordSystem.Geom property in Table A, and then paste it into the FieldCoordSystem.Geom property in Table B, all that will happen will be that Drawing B will now have assigned the wrong coordinate system, since the actual numbers within the Geom itself aren't changed by that. Doing that is equivalent to launching Repair Coordinate System and saying "whoops... this isn't supposed to be using Lat/Lon, it's really in Orthographic...".

Manifold User Community Use Agreement Copyright (C) 2007-2017 Manifold Software Limited. All rights reserved.