|
POST
|
You were very close, try : Con(IsNull("smaller"),"bigger", "smaller")
... View more
09-28-2016
08:05 AM
|
1
|
3
|
2490
|
|
POST
|
Okay Dan, Been messing with that code you posted. It seems that it goes a bit pear shaped if the rotation angle is > 45deg. Just added a few prints etc... (inside def warp to display the angles and b_cent) Test 1 : >>>
Using Rotation 44.5, Shift [1000, 2000]
Array A
[[ 1. 1.]
[ 2. 2.]
[ 3. 3.]
[ 4. 4.]]
Array B
[[-0.01851178 -2.12123957]
[-0.00617059 -0.70707986]
[ 0.00617059 0.70707986]
[ 0.01851178 2.12123957]]
Array C
[[ 999.98148822 1997.87876043]
[ 999.99382941 1999.29292014]
[ 1000.00617059 2000.70707986]
[ 1000.01851178 2002.12123957]]
inWarp - Slope A 45.0, B 89.5, D 44.5
Shifts [ 0. 0.]
Warp A -> B
[[-0.01851178 -2.12123957]
[-0.00617059 -0.70707986]
[ 0.00617059 0.70707986]
[ 0.01851178 2.12123957]]
inWarp - Slope A 45.0, B 89.5, D 44.5
Shifts [ 1000. 2000.]
Warp A -> C
[[ 999.98148822 1997.87876043]
[ 999.99382941 1999.29292014]
[ 1000.00617059 2000.70707986]
[ 1000.01851178 2002.12123957]]
inWarp - Slope A 89.5, B 89.5, D 1.67688085639e-12
Shifts [ 1000. 2000.]
Warp B -> C
[[ 999.98148822 1997.87876043]
[ 999.99382941 1999.29292014]
[ 1000.00617059 2000.70707986]
[ 1000.01851178 2002.12123957]]
inWarp - Slope A 89.5, B 45.0, D -44.5
Shifts [ 2.5 2.5]
Warp C -> A
[[ 1. 1.]
[ 2. 2.]
[ 3. 3.]
[ 4. 4.]]
>>> Test 2 : >>>
Using Rotation 45.5, Shift [1000, 2000]
Array A
[[ 1. 1.]
[ 2. 2.]
[ 3. 3.]
[ 4. 4.]]
Array B
[[ 0.01851178 -2.12123957]
[ 0.00617059 -0.70707986]
[-0.00617059 0.70707986]
[-0.01851178 2.12123957]]
Array C
[[ 1000.01851178 1997.87876043]
[ 1000.00617059 1999.29292014]
[ 999.99382941 2000.70707986]
[ 999.98148822 2002.12123957]]
inWarp - Slope A 45.0, B -89.5, D -134.5
Shifts [ 0. 0.]
Warp A -> B
[[-0.01851178 2.12123957]
[-0.00617059 0.70707986]
[ 0.00617059 -0.70707986]
[ 0.01851178 -2.12123957]]
inWarp - Slope A 45.0, B -89.5, D -134.5
Shifts [ 1000. 2000.]
Warp A -> C
[[ 999.98148822 2002.12123957]
[ 999.99382941 2000.70707986]
[ 1000.00617059 1999.29292014]
[ 1000.01851178 1997.87876043]]
inWarp - Slope A -89.5, B -89.5, D -1.67688085639e-12
Shifts [ 1000. 2000.]
Warp B -> C
[[ 1000.01851178 1997.87876043]
[ 1000.00617059 1999.29292014]
[ 999.99382941 2000.70707986]
[ 999.98148822 2002.12123957]]
inWarp - Slope A -89.5, B 45.0, D 134.5
Shifts [ 2.5 2.5]
Warp C -> A
[[ 4. 4.]
[ 3. 3.]
[ 2. 2.]
[ 1. 1.]]
>>> You see everything gets neatly reversed. And the shifts from C -> A don't look right. B -> C always works, because that's just a shift and no rotation. Thanks for your cooperation and work on this so far. Neil
... View more
09-28-2016
06:14 AM
|
0
|
9
|
7142
|
|
POST
|
Joe, wasn't trying to cast aspersions.... I guess someone "high up" thinks this is a good idea, just wondering why.
... View more
09-28-2016
06:00 AM
|
2
|
1
|
2810
|
|
POST
|
"..getting this error message" Sorry, but what error message?
... View more
09-27-2016
11:51 PM
|
0
|
1
|
2285
|
|
POST
|
migration to Hexagon's I/Cad... Really. That's a big change. Who persuaded them that this was a good idea. Is your current system not doing what you want it to do?
... View more
09-27-2016
11:37 PM
|
0
|
3
|
5944
|
|
POST
|
Thanks Dan. Looking forward to your digging into your files. Will have a play with these codes blocks in the next few days.
... View more
09-27-2016
11:35 PM
|
0
|
0
|
7142
|
|
POST
|
That's fantastic Dan. Plenty to chew over here, but once i have digested this and hopefully understand what's going on, I will attempt to push this through my problem data. Will get back to you. I presume the complicated stuff from WH is in your archive somewhere. But, this has, I hope, wider application with the broader community here. At least anyone who is faced with the problem of trying to define an ArcGIS style local projection from a set of measured points.
... View more
09-27-2016
05:14 AM
|
0
|
12
|
7142
|
|
POST
|
I have some control points from a local grid to a known grid (a national grid system). What I am trying to do is come up with the appropriate parameters to define a local prj for the input data. This involves finding the origin (or rotation point), the amount of rotation, and any shifts or scaling in X & Y. So, I have been messing with this code found here : how-to-perform-coordinates-affine-transformation-using-python-part-2 So, what I have got is (almost the same as the referenced post 😞 import sys, os
import numpy as np
localData = [["AJP1", 5671.666, 19466.156], ["GCP CR", 9634.659, 13064.567], \
["MHP2", 10325.093, 7797.802], ["MILE 8", 6508.217, 7511.953]]
refData =[["AJP1", 157171.409, 75402.914], ["GCP CR", 158414.820, 67978.050], \
["MHP2", 157059.513, 62842.546], ["MILE 8", 153418.976, 64023.272]]
inArr = np.array([[l[1], l[2], 0.0] for l in localData])
refArr = np.array([[l[1], l[2], 0.0] for l in refData])
n = inArr.shape[0]
pad = lambda x: np.hstack([x, np.ones((x.shape[0], 1))])
unpad = lambda x: x[:,:-1]
X = pad(inArr)
Y = pad(refArr)
# Solve the least squares problem X * A = Y
# to find our transformation matrix A
A, res, rank, s = np.linalg.lstsq(X, Y)
transform = lambda x: unpad(np.dot(pad(x), A))
print "Target:"
print refArr
print "Result:"
print transform(inArr)
print "Max error:", np.abs(refArr - transform(inArr)).max() which give me this : >>>
Target:
[[ 157171.409 75402.914 0. ]
[ 158414.82 67978.05 0. ]
[ 157059.513 62842.546 0. ]
[ 153418.976 64023.272 0. ]]
Result:
[[ 157171.39578228 75402.91459879 0. ]
[ 158414.84986487 67978.04864706 0. ]
[ 157059.48564043 62842.54723945 0. ]
[ 153418.98671243 64023.2715147 0. ]]
Max error: 0.0298648653843 So, I can see the fit is quite good. But how do I use the solution from np.linalg.lstsq to derive the parameters I need for the projection definition of the localData? In particular, the origin point 0,0 in the target coordinates, and the shifts and rotations that are going on here?? Tagging out very own numpy expert and all around math wiz Dan Patterson here. Or is this not even possible with this approach. My matrix math is extremely rusty to non-existent. But I am willing to try any methods offered Thanks in advance. Neil
... View more
09-26-2016
10:07 AM
|
0
|
15
|
14561
|
|
POST
|
Why don't you just bring the point cloud in as a lasd, then go from there. If I remember correctly a *.flt is a float raster file, you may be able to import that directly in as a raster. And for your answer, if you can get a raster dem, isn't the 3d area of each pixel proportional to the slope angle, so 3d pixel area = 2d pixel area / cos(slope).
... View more
09-25-2016
11:52 PM
|
0
|
1
|
1607
|
|
POST
|
Not quite sure what you are saying here about affecting the order. If you run an update and then delete specific rows based on some criteria, the record will be deleted. The row order, OID based is fairly arbitrary anyway, based on the order of creation. So, if you have OIDs 1, 2, 3, 4, 5, then you delete 2 & 3, you will be left with OIDs 1, 4 & 5. It will not automatically re-order or re number the remaining OIDs. To do that you would have to do a copy features or something to a new table.
... View more
09-25-2016
04:01 AM
|
1
|
0
|
3637
|
|
POST
|
ArcGIS version etc. Are you absolutely sure that the 2 datasets have the same coordinate system? They might overlie in ArcScene, but this could be because of project on-the-fly.
... View more
09-25-2016
01:52 AM
|
0
|
0
|
989
|
|
POST
|
If Ianko's stuff at ET doesn't do enough for you... What sort of extra functionality are you looking for?
... View more
09-22-2016
11:52 PM
|
0
|
0
|
1024
|
|
POST
|
Yes, I think you are on the right track. You may have to investigate the beginning and end times for each period to get it to display correctly. There is a tool to do this. calculate-end-time
... View more
09-22-2016
12:02 PM
|
0
|
0
|
1510
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 09-08-2015 11:28 PM | |
| 1 | 12-20-2013 08:59 PM | |
| 1 | 05-14-2014 10:38 PM | |
| 1 | 12-16-2013 09:05 PM | |
| 1 | 05-31-2019 02:50 AM |
| Online Status |
Offline
|
| Date Last Visited |
11-11-2020
02:23 AM
|