ue4plugins / UEGeoCoordinates

Provide tools for users to express Coordinates in different Geographic Coordinates Reference Systems
MIT License
135 stars 43 forks source link

Conversion when using arcGISsdk plugin does not work? #13

Open jwielebnowski opened 3 years ago

jwielebnowski commented 3 years ago

I am on UE 4.26.1 I cannot get conversion working when in the game that uses ArcGISMapSDK for Unreal. Game created with simple steps:

  1. Create C++ empty game
  2. Add ArcGISMapSDK
  3. Select global scene with original location lat/long - 51.044701, -114.071899
  4. Add ArcGIS API key
  5. Select World Imagery

For the simulation plugin:

Projected CRS - EPSG:3403 Geographic CRS - EPSG:4326 Origin Projected X 65774 Origin Projected Y 5645079

Calculated original projection shows wrong lat/long location. 35.76269572, -78.73241143

Please find attached screenshots with all the settings including level blueprint with projection conversion and the game original output.

I wonder if I am using the plugin incorrectly or it just not working with ArctGIS sdk?

Jacek EPSG4326-EPSG3403 GameArcGISController GameEPSG4326-EPSH3403

jwielebnowski commented 3 years ago

LevelBlueprint

AlbanBERGERET-Epic commented 3 years ago

I tested it there with the latest version of the plugin and it works perfectly...

What I find strange with your application is that the Projected coordinates are 705000, 3960000 whereas they should have been 65774, 5645079. IMO there is something wrong with your settings.

In this github version, there are 2 locations where you define the origin location

If the level contains this actor, the project settings are ignored. And the 705000 3960000 values are those set by default. (Epic HQ in UTM...). It seems the georef system is initialized with the wrong ones. Where did you put your values. If it is in the project settings, make sure you don't have the georef actor in your level.

In the beginning, we thought it was easier when using several levels in a project, but in fact it is confusing, that's why we'll remove the project settings location in the next version.

ESRI 2021-03-08 16_49_50-SimulationDemo - Unreal Editor

jwielebnowski commented 3 years ago

Packaged game shows a little bit better Not sure why is so much difference. packaged

jwielebnowski commented 3 years ago

Alban, Thank you for your quick response. You were right, I had another settings in the GeoreferencingActor, which took over in the editor simulation. In the stand alone game, the projects settings took over so it shows much better. However, the values are still not correct. They are off. Here is what I see. The origin values set in the global scene do not match values reported in the game. It should be 51.044701 and -114.071899, but the plugin calculates in my version to 50.97389123, -114.06279879 and in yours to 50.97649004,-114.0745429.

image

Here is the example what the game is reporting versus the location on the map. I moved the game into the island. But the game reports the location a couple kilometers south. It does not look correct. And the movement is not correct either. I go East and game calculates West. Here are the screenshots from the game and what it reports to the map.

image Map with game location

It seems like the calculation is not correct. Can you confirm?

AlbanBERGERET-Epic commented 3 years ago

Hi,

When just starting the application with your referencing. I have this status bar : [image: image.png]

Projected coordinates are correct, and if I transform between 3403 and 4326, I got what is displayed in the status bar. [image: image.png]

So I guess our computations are correct. If I do the opposite, taking the Lat/long you used in the ESRI origin I get other results for the EPSG:3403 coordinates... [image: image.png] If I enter the right values in the georeferencing system, it seems consistent...

[image: image.png] [image: image.png] [image: image.png]

So I think you made a mistake when computing your origin coordinates...

WRT your wrong deplacement mode, I indeed just noticed that ESRI chose a different coordinate convention, with X pointing north and Y pointing East. Thanks for pointing that out, I did not notice that before, and I'll fix it in the next release ! For now, as a workaround, you can patch your engine coordinates before calling Engine to Projected something like X->Y, Y->X, Z->Z (TBC)

On Tue, Mar 9, 2021 at 10:44 AM Jacek Wielebnowski notifications@github.com wrote:

Alban, Thank you for your quick response. You were right, I had another settings in the GeoreferencingActor, which took over in the editor simulation. In the stand alone game, the projects settings took over so it shows much better. However, the values are still not correct. They are off. Here is what I see. The origin values set in the global scene do not match values reported in the game. It should be 51.044701 and -114.071899, but the plugin calculates in my version to 50.97389123, -114.06279879 and in yours to 50.97649004,-114.0745429.

[image: image] https://user-images.githubusercontent.com/8700191/110495039-5cd59500-80b1-11eb-9b42-2f985458278a.png

Here is the example what the game is reporting versus the location on the map. I moved the game into the island. But the game reports the location a couple kilometers south. It does not look correct. And the movement is not correct either. I go East and game calculates West. Here are the screenshots from the game and what it reports to the map.

[image: image] https://user-images.githubusercontent.com/8700191/110496172-77f4d480-80b2-11eb-9fd4-dbd7d42c86cc.png [image: Map with game location] https://user-images.githubusercontent.com/8700191/110496842-21d46100-80b3-11eb-8883-676a32985680.PNG

It seems like the calculation is not correct. Can you confirm?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/ue4plugins/UEGeoCoordinates/issues/13#issuecomment-794066949, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOHZBQ7LEDHPWCKE2RW6ZQLTCYX4PANCNFSM4Y2FP55A .

jwielebnowski commented 3 years ago

I don't see your images. Did you attach them?

AlbanBERGERET-Epic commented 3 years ago

Sorry, it's because I used my web client to answer...

When just starting the application with your referencing. I have this status bar : 1

Projected coordinates are correct, and if I transform between 3403 and 4326, I got what is displayed in the status bar. 2

So I guess our computations are correct. If I do the opposite, taking the Lat/long you used in the ESRI origin I get other results for the EPSG:3403 coordinates... 3

If I enter the right values in the georeferencing system, it seems consistent...

4 5 6

So I think you made a mistake when computing your origin coordinates...

WRT your wrong deplacement mode, I indeed just noticed that ESRI chose a different coordinate convention, with X pointing north and Y pointing East. Thanks for pointing that out, I did not notice that before, and I'll fix it in the next release ! For now, as a workaround, you can patch your engine coordinates before calling Engine to Projected something like X->Y, Y->X, Z->Z (TBC)

jwielebnowski commented 3 years ago

Thank you, thank you. Yes, my initial projection values where wrong. The game starts perfectly now. However, I cannot work around the problem with updated location. It is like x/y scale in the game is wrong. I have tried different adjustments and this is the best one I got. scale blueprint Direction going E-W and N-S is correct, however, going N-S calculates distance that is too much: scale show game island scale sho map island and going E-W too little: scale show EW game scale show EW map

So, I am thinking that it will not be able to work around the problem only by updating X/Y engine coordinates. Anything else you can suggest to work around that, or we need updated version?

AlbanBERGERET-Epic commented 3 years ago

Well, I also just something strange while looking at this issue report : https://github.com/ue4plugins/UEGeoCoordinates/issues/14

It seems that ESRI have their own rebasing algorithm and are not using the central one of the engine. Doing that, the georeferencing plugin is not able to compute the right coordinate. I just signaled them the issue. Hopefully they will address it soon. (IDK if they can provide their rebasing offset in a blueprint node).