ESRI Shapefiles in MP

I use ArcGIS quite a lot when planning out flights and I can see the utility in being able to import an ESRI shapefile into Mission Planner. It would allow some users to use a GPS such as a Trimble to shoot GCPs then use them as waypoints and camera trigger points in imagery missions. Is this something that is already incorporated into the MP code and I am just missing it? I guess that the SHP could be exported to a KML/KMZ overlay. With the SHP (from the GPS shots) the exact lat/long of a known ground landmark could be utilized as a GCP which could further enhance the accuracy of the resultant imagery.

Anyone else doing this?

You need to be a member of diydrones to add comments!

Join diydrones

Email me when people reply –


  • This describes a temporary solution for the challenge:

    • Gents: This is precisely why I finally created an acct. with DIYD! I'm a GISer that realizes the HUGE potential of this blog and work done in DIYD. I've been following the blog for about 10 months but scaled back for the last few and really missed this discussion until today! I'm so glad to see this support and topic. 

      RL's post with the py script is a great start--thanks.

       I was very happy to read the discussion go into OGR/GDAL, but I'm sad to see it went back to .shp as the preference since there are limits inherent in that format. I work with ESRI software daily but I've been easing into QGIS as my hobbyist GIS. The latter plays with python and works well with FGDBs too. Anyhow, I think python might be a great answer here because it could probably accommodate  whatever desktop GIS flavor you like.

      I can't claim to be a programmer--more of a cobbler...but I'm not bad with GIS (+12 yrs exp.). I would be very glad to work with a group to move this along if we can. Since I'm new to this community I'm not sure how this works. PM me if interested?

  • Developer

    latest beta MP supports reprojection on the fly. so you should be able to load almost any coord system.

    • It'll definitely reproject on the fly. It just did something kind of unexpected and REALLY cool. I gave it a polygon SHP instead of a point SHP and it interpreted the polygon centroids as WPTs. That was pretty cool. Maybe not what you wanted to hear, but cool nonetheless!

      This means that in order for us to get WPTs done in ArcGIS (or anything else using SHPs for that matter) we will likely have to set them up first in ArcGIS and then import the point SHP only into MP. The point SHP DBF schema should have at the minimum a field named WP for WPT number and ELEVATION for altitude in meters.

      Side note...

      Would it be possible to get a listing of all of the WPT type codes that MP uses? By that, I mean TAKEOFF, LAND, WAYPOINT, DO_SET_<command>, etc? I noticed that there is definitely a pattern to them, but I haven't figured it out yet. Those of us in ArcGIS could use these as subtypes in a geodatabase where we build our WPT features and set types with a dropdown menu, then export them directly to a SHP for MP. if I could just get that pesky KML export from ArcGIS to work right, I could use my tract polygons in MP. This isn't on is definitely an ArcGIS/ESRI issue. It has been ever since they attempted to implement "Export LYR to KMZ" support in ArcGIS.

    • Michael you rock! I'll give it a good workout tomorrow at the office!

  • Developer

    ok the plan is

    points should have lat/long coords

    "ELEVATION" from the dbf will be read in as the wp altitude.

    "wp" from the dbf file will be sorted an imported from 0 to 99.. etc


    all that make sence?

    • Yes, that would be great. I just have 2 questions:

      1) Would there be a limit for the number of WPs?

      2) If the DBF contains other fields that aren't named WP, lat, long or elevation, will MP ignore them? 

      • Developer

        1. only limited by the autopilot itself, currently apm 2 has about 160 wp. and I know that the next pixhawlk release should be around 900 wp's


        2. mp will ignore all other values, other than ELEVATION and wp.


        ive uploaded the beta of this already.

        • Thanks, I updated the beta. However, when I import the shapefile now, there are 2 problems.

          1) The alt field is populated by the default altitude, which is similar problem to the previous beta. I even tried to edit the DBF by deleting all fields except for WP and elevation. Is there a way to override the default altitude? 

          2) The WPs are not numbered properly anymore. This did not occur in the previous beta.

          In my original flight plan, all flight lines were parallel (except for the take-off/landing), but when I import the SHP, I get crossed lines. See attached screenshots. 



          • Developer

            ok new beta uploading.

            this one has a combination of things

            For Altitude it uses in this order

            1. ELEVATION in dbf

            2. alt in dbf

            3. the Z component of the point.

            for wp number

            1. wp in dbf

            2. order they appear in the file.

            if the wp is in the dbf the points are sorted lowest to highest.


This reply was deleted.


Neville Rodrigues liked Neville Rodrigues's profile
Jun 30
Santiago Perez liked Santiago Perez's profile
Jun 21