Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AviTab map export #310

Closed
albar965 opened this issue Oct 7, 2018 · 19 comments

Comments

@albar965
Copy link
Owner

commented Oct 7, 2018

Add an image export function for AviTab

{
  "calibration": {
    "latitude1": 51.8425,
    "latitude2": 44.831,
    "longitude1": -8.4895,
    "longitude2": -0.7134,
    "x1": 0.1722338204592902,
    "x2": 0.541660487940095,
    "y1": 0.11333186101295643,
    "y2": 0.9629301675667267
  }
}

eick-lfbd_night

@albar965 albar965 added this to the Release 2.2.X milestone Oct 7, 2018

@albar965 albar965 self-assigned this Oct 7, 2018

@fpw

This comment has been minimized.

Copy link

commented Oct 7, 2018

That's a cool idea - AviTab can import Mercator maps and use them as moving map in the cockpit or 3D EFBs. If you want to suggest a more sophisticated format to add geo-referencing information to the exported images, I could integrate a parser for that into AviTab so that the exported format can be used in other applications as well. For example, AviTab already supports GeoTIFFs using arbitrary projections.

@albar965

This comment has been minimized.

Copy link
Owner Author

commented Oct 8, 2018

Hi,
Sorry for the delay I'm "deep diving" into some really annoying bugs here. :-/

GeoTiff sounds great if you support that already. Could be useful for other programs too.
Qt can do Tiff anyway. I just have to find out how I can get the georeferencing data into the metatags.
Alex

@albar965

This comment has been minimized.

Copy link
Owner Author

commented Jan 13, 2019

@fpw What is the meaning of the values below?

    "x1": 0.1722338204592902,
    "x2": 0.541660487940095,
    "y1": 0.11333186101295643,
    "y2": 0.9629301675667267

Could not find anything in the documentation. What image format and filename is expected?
Alex

@fpw

This comment has been minimized.

Copy link

commented Jan 13, 2019

@albar965 The ((x1, lon1), (y1, lat1)) and ((x2, lon2), (y2, lat2)) tuples translate from world coordinates to coordinates inside the image file. I used float coordinates instead of pixels to support vector formats like PDF as well. (0, 0) is the top left of the image and (1, 1) is the bottom right in xy space.

@fpw

This comment has been minimized.

Copy link

commented Jan 13, 2019

For the file name - it should be a copy of the image name with an additional .json extension, for example myMap.png.json. Supported formats are JPG and PNG.

@albar965

This comment has been minimized.

Copy link
Owner Author

commented Jan 13, 2019

@fpw: So, for displaying the whole image x1=0, y1=0, x2=w, y2=h.
Where w and h are image dimensions in pixels.
This would be OK, right?
Alex

@fpw

This comment has been minimized.

Copy link

commented Jan 13, 2019

@albar965 No, the coordinates are normalized so that (0, 0) to (1, 1) always covers the whole image. (0.5, 0.5) would be the center of the image. The image is always displayed as a whole, the pairs are only used to calibrate two arbitrary points in the image. Using the top left and bottom right as calibration points would be the most precise, though.

@albar965

This comment has been minimized.

Copy link
Owner Author

commented Jan 13, 2019

I see. Thanks for the quick answers. For now I prefer the JSON and PNG over GeoTiff. A bit easier to implement for me.
Alex

@fpw

This comment has been minimized.

Copy link

commented Jan 13, 2019

Sounds great, thanks!

albar965 added a commit that referenced this issue Jan 15, 2019

@albar965

This comment has been minimized.

Copy link
Owner Author

commented Jan 15, 2019

Done. A few examples attached. Can save PNG or JPG.
EDFE_EDXW.zip
Alex

@albar965 albar965 closed this Jan 15, 2019

@fpw

This comment has been minimized.

Copy link

commented Jan 18, 2019

I can load the examples successfully, thanks a lot! Which map projection do the images use? It looks like the position calculated by AviTab is slightly offset to the south as if the image uses a Lambert instead of a Mercator projection. In the attached image, the aircraft is actually standing on the blue airport.

avitab

@albar965

This comment has been minimized.

Copy link
Owner Author

commented Jan 19, 2019

Thanks for testing and the feedback. The projection is a Mercator for sure. I even show a warning dialog if the user has the wrong projection (LNM uses only spherical and Mercator).
In my last tests the aircraft was positioned correctly. Will check again. Maybe I'm using a wrong offset from
the window. Probably also have to test far South/North situations.
Alex

@fpw

This comment has been minimized.

Copy link

commented Jan 19, 2019

I used your EDFE_EDX_3 example file and positioned my aircraft on an EDHL runway for the above screenshot.

@albar965

This comment has been minimized.

Copy link
Owner Author

commented Jan 19, 2019

Will check. BTW: Thanks for also supporting Linux! Makes testing for me much easier. :-)
Alex

@albar965

This comment has been minimized.

Copy link
Owner Author

commented Jan 20, 2019

@fpw: Hi Folke,
I looked again at the export, tested a few ones and cannot find a distortion or any other errors. EDHL is south of the cyan/blue dot indicating the Lübeck city center. Looking OK to me.

I'll release a RC for 2.2.4 soon and will drop you a line.

Alex

grafik

grafik

@fpw

This comment has been minimized.

Copy link

commented Jan 20, 2019

My mistake then, sorry! I thought the blue dot indicated the airport position and not the city center.

@albar965

This comment has been minimized.

Copy link
Owner Author

commented Jan 20, 2019

Kein Problem. :)

@albar965

This comment has been minimized.

Copy link
Owner Author

commented Jan 26, 2019

Hi Folko,
here's a release candidate: https://www.avsim.com/forums/topic/549357-little-navmap-224rc1/

I hope I can get the window size limitation out in the future so you can save arbitrary image sizes.
Alex

@fpw

This comment has been minimized.

Copy link

commented Jan 26, 2019

Did a few tests and it works perfectly! Thanks a lot. I posted in the forum about it: https://forums.x-plane.org/index.php?/forums/topic/169403-new-avitab-feature-in-littlenavmap/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.