Wednesday, June 17, 2015

3D Printing Map Markers


Purpose


3D Print map markers for use with paper maps.

Methods and Materials

Hardware:
MTU-MOST Rep-rap 3D Printer
PLA plastic

Software:
Trimble Sketchup
Cura
Repetier Host


Steps:

1. Design a map marker using Trimble Sketchup (formerly Google Sketchup).  Export as an OBJ file.

2. Use Cura to open the OBJ file and save into GCODE for use with the 3D Printer

3. Use Repetier Host to print the GDODE

Settings:
25% fill


Future


  • Add magnets to the markers for use on whiteboards
  • Add label holders
  • Standardize symbology for Fire/EMS/Emergency Management use

Thursday, January 29, 2015

Decompiling Android ADK files

Decompile Android ADK files to understand how an application works or to gain an understanding of an undocumented API.

Step 1: Get the ADK file

Use AirDroid or you can grab .adk file from the phone itself.

If you rename the application.adk to application.zip, you can open the file and view much of the application except the code itself.

Note: Some applications are compiled using PhoneGap.  When renaming the apk to zip, check out the assets folder for the web data.

Step 2: Decompile ADK

To view the android java code, you must decompile the DEX file.

https://code.google.com/p/dex2jar/wiki/ModifyApkWithDexTool

windows shell

% cd c:\path-to-someApk.apk

% C:\dex2jar-version\d2j-dex2jar.bat someApk.apk

Step 3: Use a viewer to browse JAR file

After you've decompiled the dex file, you will have a .jar file.  There are many options for exploring this but here is an example

jd-gui




That is it!  Browse the code.


Tuesday, January 27, 2015

Geodatabases, ER Diagrams, and Visio

An important step in the planning a geodatabase is creating an Entity-Relationship (ER) diagram.   Here is how you can add support for geospatial database modeling1 to Visio 2013 using the Chen's Database Notation.

This tutorial uses Visio 2013 Professional on a Windows 7 machine.

Custom Visio Template for Geospatial Entity

Start

Create blank drawing
Open Chen's Database Notation.  
More Shapes > Software and Database > Chen's Database Notation
Select all the shapes (Entity, Relationship, Attribute, Relationship Connector) and
Right click and choose Add to My Shapes > Add to New Stencil
Save the Stencil with a filename you'll recognize.  I used GeoStencil
Right click on the GeoStencil and choose Edit Stencil

//TODO [insert video]

Entity

Right click on Entity and select Copy
Paste
Right click and Rename the Master to GeoEntity
Right click on GeoEntity and choose Edit Master > Edit Master Shape
Use the Line tool to draw the horizontal line and two vertical lines.
Click on the Text and resize the current text box.
Type in "Object (entity)" in the original label.
Add three new text boxes.  Type in "Spatial Object", "G", and "T"

  • Spatial Object is the Associated Spatial Object Type
  • G represents the XY Coordinate Indicator
  • T represents the Topology Indicator

Close the window. It will ask you to "Update GeoEntity?"  Choose Yes.

//TODO [insert video]

Entity Temporal

Copy the GeoEntity shape and rename to GeoEntity Temporal
Edit the Master > Edit Master Shape
Highlight all shapes and select Group.
Copy and paste
Edit the new shape and remove the text.
Send to back
Copy and paste new empty shape and send to back.
Rearrange them.
Highlight all and select Group.
Close the window.  It will ask you to "Update GeoEntity Temporal?"  Choose Yes.

//TODO [insert video]

Topology

Right click on Relationship and select Copy
Paste
Right click and Rename the Master to GeoTopology
Right click on GeoTopology and choose Edit Master > Edit Master Shape
Delete the current shape.
Use the Line tool to draw a hexagon.

Close the window. It will ask you to "Update GeoEntity?"  Choose Yes.

//TODO [insert video]

Derived Topology

Right click on GeoToplogy and select Copy
Paste
Right click and Rename the Master to GeoDerivedTopology
Right click on GeoDerivedTopology and choose Edit Master > Edit Master Shape
Select the shape, copy and paste.
Resize the new shape
Send to Back
Highlight both shapes and select Group > Group

Close the window. It will ask you to "Update GeoEntity?"  Choose Yes.

//TODO [insert video]


If anyone has ideas on how to improve this or if there are other technologies that do something similar, please let me know.

References

1 Calkins, Hugh W., Entity Relationship Modeling of Spatial Data for Geographic Information Systems, International Journal of Geographical Information Systems, January 1996.
Link

Tuesday, December 23, 2014

Wind Meter


Weatherflow Wind Meter

Here is a new gadget that may be useful for UAV pilots.   As the FAA regulations are still somewhat vague, a log book for UAV flight is a good idea to prepare for more string rules.  The app provides windspeed and direction which you can add to your flight data.

Source: http://weatherflow.com/

Cost: $35 USD

Weight: 16.4 g


Monday, November 24, 2014

Thursday, November 20, 2014

Python Sets to Align CSV Columns

From recent work, I've found Python set operations to be easier than using Excel VLOOKUP or MATCH formulas.  Here are a few uses:

Visually align two columns from a CSV file, adding the phrase "--MISSING--" into columns where values do not match.

SOMEFILE = '/path/to/some/file.csv'

with open(SOMEFILE, 'r') as csvfile:
                filereader = csv.reader(csvfile, delimiter=',',quotechar='"')
                for row in filereader:
                        set_old.add(row[0])  #column 0

                        set_new.add(row[1])  #column 1

total = sorted(set_old|set_new)
list1 = [x if x in set_old else "--MISSING--" for x in total]
list2 = [x if x in set_new else "--MISSING--" for x in total]

for i in range(0, len(list1)):
                print i, "\t", list1[i], "\t", list2[i]


You can follow this up and pipe the output to "column -t" command in linux to produce an easy to read list.

python script.py | column -t

For example

Column0        Column1
1                     2
2                     3

would become:

Column0        Column1
1                     --Missing--
2                      2
--Missing--      3

It is very easy to pull keys from an existing array or dictionary and perform set operations on them such as comparing lists of users in access or configuration files.

for user in new_users.difference(old_users):
         print user



Here are some other interesting set functions:

A = set(['1','2','3','4'])
B = set(['3','4','5','6'])
C = set(['1','2','3','4','5','6','7','8','9','10'])
D = set(['1','2'])

A.issubset(B)
False

A.issubset(C)
True

A.issuperset(B)
False

A.issuperset(D)
True

A.intersection(B)
['3','4']

A.union(B)
['1','2','3','4','5','6']

A.difference(B)
['1','2']

A.symmetric_difference.B
['1','2','5','6']

Have you used Python sets in Geospatial applications?  Let me know how in the comments.

https://docs.python.org/2/library/sets.html


Wednesday, November 12, 2014

Safety and the National Air Space

Update(11/24/2014)

FAA

The FAA may some day require some type of pilots license to commercially operate UAV safely in the National Air Space.  With legislation expected by the end of the year, it seems like a good idea to start reviewing the FAA knowledge tests.

https://www.faa.gov/training_testing/testing/test_guides/

Check out the Recreational Pilot and Private Knowledge Test.  This has resources covering airplanes, helicopters, gliders, balloons, and airships, all of which have useful information for safely and effectively operating a variety of aerial vehicles.

This resource has good information on learning the physics and prerequisite knowledge for flying.
http://www.faa.gov/regulations_policies/handbooks_manuals/aviation/pilot_handbook/

DJI Phantom 2 Vision Plus

While DJI Phantom supports "no fly zones" of 5 miles around airports, it is very easy to overlook that  this only includes class A and B airports. These are basically the large international airports.   Smaller airports are not included.  It is still possible to accidentally fly near an airport.

Before flying in unknown areas, I recommend exploring the area with Google or Bing Maps to check for the presence of airports and other potentially hazards nearby.  It's pretty easy to get swept up with the excitement of flying.

I did contact DJI about adding airports to the no fly zone and this is how they replied:

Dear DJI Customer,

Thank you for contacting DJI with your question about No Fly Zones.
Please see the websites below for quick reference. For further enquiries, please reply to this email with support@dji.com in CC, and we will get back to you as soon as possible.
Best Regards,
DJI Fly Safe Team