-
Notifications
You must be signed in to change notification settings - Fork 327
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
Feature Request - Ability to Save Geozones as an XML file #2323
Comments
Good idea. Nicer than reading / writing CLI fles (which is what <?xml version="1.0" encoding="utf-8"?>
<geozones>
<geozone id="0" shape="circle" type="exclusive" minalt="123.0" maxalt="456.0" is_amsl="false" action="avoid">
<vertices>
<vertex id="0" latitude="54.3556810" longitude="-4.5287920" radius="160.0"/>
</vertices>
</geozone>
<geozone id="1" shape="polygon" type="inclusive" minalt="0.0" maxalt="200.66" is_amsl="false" action="poshold">
<vertices>
<vertex id="0" latitude="54.3535614" longitude="-4.5303353"/>
<vertex id="1" latitude="54.3518405" longitude="-4.5288563"/>
<vertex id="2" latitude="54.3512220" longitude="-4.5223563"/>
<vertex id="3" latitude="54.3530456" longitude="-4.5172406"/>
<vertex id="4" latitude="54.3530815" longitude="-4.5157285"/>
<vertex id="5" latitude="54.3539360" longitude="-4.5122910"/>
<vertex id="6" latitude="54.3553608" longitude="-4.5105164"/>
<vertex id="7" latitude="54.3569302" longitude="-4.5136845"/>
</vertices>
</geozone>
</geozones> |
@b14ckyy @Scavanger Do you see problems with this (like there are other non-geometric GeoZone parameters that make this impractical) ? Otherwise I'll draft up a XSD for review as a path to standardisation across planners. |
Geozones could be simply transferred via cli by copying the relevant part of a diff. Editing is not recommended of course. But I am open for any QoL feature as it makes a lot of sense to copy zones between crafts and even edit offline when the new Mission control is ready. In this case I would even say that this exports also the safe homes in the same go. What do you think? Edit: the settings for safehome are also split between 2 areas for a reason. The settings that will be plane specific based on flight performance are in advanced tuning. For geozones we also have a few additional settings but these are also aircraft specific and not relevant for transferring between aircraft. |
I think the whole issue / real issue is UX / Usability. Not being able to offline edit and persist to the file system artefacts such as Geozone (and Safehome) is a usability bug. The file format is somewhat irrelevant, as long as it is documented so we have an interoperable format between products. OTOH, I find <?xml version="1.0" standalone="yes"?>
<gezones>
<geozone id="0" shape="circle" type="exclusive" minalt="23.0" maxalt="12300.0" is_amsl="true" action="avoid">
<vertices id="0" latitude="54.355681" longitude="-4.528792" radius="160.0"/>
</geozone>
<geozone id="1" shape="polygon" type="inclusive" minalt="0.0" maxalt="10000.0" is_amsl="false" action="none">
<vertices id="0" latitude="54.3535614" longitude="-4.5303353"/>
<vertices id="1" latitude="54.3518405" longitude="-4.5288563"/>
<vertices id="2" latitude="54.351222" longitude="-4.5223563"/>
<vertices id="3" latitude="54.3530456" longitude="-4.5172406"/>
<vertices id="4" latitude="54.3530815" longitude="-4.5157285"/>
<vertices id="5" latitude="54.353936" longitude="-4.512291"/>
<vertices id="6" latitude="54.3553608" longitude="-4.5105164"/>
<vertices id="7" latitude="54.3569302" longitude="-4.5136845"/>
</geozone>
<geozone id="2" shape="polygon" type="exclusive" minalt="0.0" maxalt="10000.0" is_amsl="false" action="none">
<vertices id="0" latitude="54.3554831" longitude="-4.5247084"/>
<vertices id="1" latitude="54.3567914" longitude="-4.5185943"/>
<vertices id="2" latitude="54.358035" longitude="-4.519585"/>
<vertices id="3" latitude="54.3595101" longitude="-4.5246121"/>
<vertices id="4" latitude="54.3579793" longitude="-4.5268677"/>
</geozone>
<geozone id="3" shape="circle" type="inclusive" minalt="0.0" maxalt="10000.0" is_amsl="false" action="rth">
<vertices id="0" latitude="54.356769" longitude="-4.516625" radius="115.0"/>
</geozone to be a far more useful, human readable representation than:
Back to UX again .... |
As far as One way of managing this would be to add some "options" (hints) to the XML file, which the application could choose to ignore when connected to a FC and having access to specific parameters for a particular aircraft. So, for the CLI fragment:
One might end up with a more readable application (INAV Configurator, mwp) XML file: <?xml version="1.0" standalone="yes"?>
<safehomes>
<description version="1.0" generator="clish2xml.rb">
<options name="nav_fw_land_approach_length" value="150"/>
<options name="nav_fw_loiter_radius" value="40"/>
</description>
<safehome id="0" enabled="true" latitude="54.3540248" longitude="-4.5237071"/>
<safehome id="1" enabled="true" latitude="54.3563486" longitude="-4.5129749"/>
<safehome id="2" enabled="false" latitude="54.3526527" longitude="-4.5269011"/>
<safehome id="3" enabled="true" latitude="54.3539528" longitude="-4.5132527"/>
<safehome id="4" enabled="false" latitude="0.0" longitude="0.0"/>
<safehome id="5" enabled="false" latitude="0.0" longitude="0.0"/>
<safehome id="6" enabled="false" latitude="0.0" longitude="0.0"/>
<safehome id="7" enabled="false" latitude="0.0" longitude="0.0"/>
<fwapproach approachalt="60.0" index="0" landalt="0.0" landheading1="0" landheading2="-330" approachdirection="right" sealevelref="false"/>
<fwapproach approachalt="126.87" index="1" landalt="26.87" landheading1="1" landheading2="-70" approachdirection="left" sealevelref="false"/>
</safehomes> |
Since Autoland representations on the Map are depending on the individual plane config and make not much sense to be edited offline anyway, they could just be ignored in offline mode and only loaded when a FC is connected or if a FC was connected, taking the last known settings into account. If the User switches the FC to import the Zones or Safe Homes, MWP or Configurator could update the map drawings. |
Attached are proposed safehome and geozone schemas (with sample files and backing CLI data).
|
How about GeoJSON? https://geojson.org/ A zone could be represented as a feature, with a polygon as geometry and the options can be defined as properties.
|
GeoJSON is also use often with GIS tools, so it is likely has the potential to integrate well with other tools. |
That could work. GeoJSON has no means to represent a circle. You could just use points (centre and a property) or multi-point , however only bespoke tools would be able to decode them as circles. So the "GIS tools" integration potential is not that great. Or you have the properties INAV needs as properties, and the circle as a polygon for "other tool" visualisation and the file becomes rather large and not human readable (this is what mwp does for its KML conversion). I have no preference either way, however I feel we will get better interoperability between tools with a formal schema. |
The lack of circle is indeed a valid concern. A common workaround seems to define circles as a point with a radius property. That may not be ideal, but would keep it short and simple. A plus that may be overlooked is that js mapping libraries, like leaflet tend to support geojson and may do most of the work for us when reading/exporting. (At least on the configurator side). We still would need to translate it into msp, but that is true for any format we pick.
(I am ok with a custom xml schema as well) |
Just a note:
I am also OK with either. If we do go the GeoJSON route, we need to:
|
I took the KML from the original example, converted it to GeoJSON, added INAV / Geozone properties, remove the polyline interpretation of the circles. Imported into QGIS: Circles are just points of course. Valid GeoJSON: {
"crs" : {
"properties" : {
"name" : "urn:ogc:def:crs:OGC:1.3:CRS84"
},
"type" : "name"
},
"features" : [
{
"geometry" : {
"coordinates" : [
-4.5287920,
54.3556810
],
"type" : "Point"
},
"properties" : {
"Description" : "INAV Geozone",
"Name" : "Circle 1",
"Type" : "Exclusive",
"Action" : "Avoid",
"MinAlt" : 23.0,
"MaxAlt" : 120.0,
"IsAMSL" : true,
"Radius" : 160.0
},
"type" : "Feature"
},
{
"geometry" : {
"coordinates" : [
[
[
-4.5303353,
54.3535614
],
[
-4.5288563,
54.3518405
],
[
-4.5223563,
54.351222
],
[
-4.5172406,
54.3530456
],
[
-4.5157285,
54.3530815
],
[
-4.512291,
54.353936
],
[
-4.5105164,
54.3553608
],
[
-4.5136845,
54.3569302
],
[
-4.5303353,
54.3535614
]
]
],
"type" : "Polygon"
},
"properties" : {
"Description" : "INAV Geozone",
"Name" : "Polygon 1",
"Type" : "Inclusive",
"Action" : "None",
"MinAlt" : 0.0,
"MaxAlt" : 100.0,
"IsAMSL" : false
},
"type" : "Feature"
},
{
"geometry" : {
"coordinates" : [
[
[
-4.5247084,
54.3554831
],
[
-4.5185943,
54.3567914
],
[
-4.519585,
54.358035
],
[
-4.5246121,
54.3595101
],
[
-4.5268677,
54.3579793
],
[
-4.5247084,
54.3554831
]
]
],
"type" : "Polygon"
},
"properties" : {
"Description" : "INAV Geozone",
"Name" : "Polygon 2",
"Type" : "Exclusive",
"Action" : "None",
"MinAlt" : 0.0,
"MaxAlt" : 100.0,
"IsAMSL" : false
},
"type" : "Feature"
},
{
"geometry" : {
"coordinates" : [
-4.5166250,
54.3567690
],
"type" : "Point"
},
"properties" : {
"Description" : "INAV Geozone",
"Name" : "Circle 2",
"Type" : "Inclusive",
"Action" : "RTH",
"MinAlt" : 0.0,
"MaxAlt" : 1000,
"IsAMSL" : false,
"Radius" : 115.0
},
"type" : "Feature"
}
],
"name" : "geozones",
"type" : "FeatureCollection"
} |
|
That was my attempt at writing an example by hand. I did not try to pass it through link. Been a while since I actually used GeoJSON. Nice to see you managed to convert from KML to GeoJSON and make it work with my suggestion. Quick summary: geoJSON:
Cons:
XML:
Cons:
|
Geozones is an incredible new feature that will help many pilots avoid flying in areas where they should not. and make RTH even more effective. I have multiple aircraft and in an ideal world, I would like to be able to define Geozones that I can create once and easily load onto multiple aircraft. I currently do that with Missions.
Current Experience:
Desired Experience:
Geozones can be created in Mission Planner without needing to be connected to a flight controller
Geozone can also be saved as an XML file locally on the computer that is running the configurator
Geozones can be loaded from the XML file into the configurator
Thank you for considering this and for all the work you do making INAV amazing.
The text was updated successfully, but these errors were encountered: