MapIt GIS – Spatial Asset Collection, GPS Surveys and Spatial Data Management for Android

Please check out my new app for Android.

More details: http://mapit-gis.com
Get the app from Google Play

– Mobile app for asset collection, data management and environmental surveys.
– Survey layers (point, line, polygon).
– Attributes management.
– Google Maps, Bing Maps, Open Street Map base maps.
– Support for offline maps & Mapbox maps.
– Export, Import, Share (CSV, KML, geojson, arcjson).
– Measurement of the area, perimeter and distance.
– Support for multiple measurement units.
– Support for number of local coordinate systems.

pic1

 

Typical usage: environmental surveys, soil surveys, trees surveys, soil types mapping, mapping ecosystems, contractions, land measurement, real estate mapping, snow removal and many other to discover…

Related article: https://osedok.wordpress.com/2015/02/18/mapit-gis-data-collector

Generating mbtiles from an image

In number of emails I have been asked how to create an offline map from geo-referenced image. Please follow this article to create .mbtiles file ready to use with MapIt from an image. We use open source software to achieve the goal.

You need to have:

Please follow the steps below to get the offline map of Kilimanjaro in format compatible with MapIt:

1. Open qGIS and open a Georeferencer plugin as shown below:

qGIS Georeferencer plugin
qGIS Georeferencer plugin

2. Add your image to the plugin and set the spatial reference – you can use filter typing 4326 in the filter box.

Choose WGS84  spatial reference for your image
Choose WGS84 spatial reference for your image

3. Selecting georeferencing points.

Depending from the type of image you may use 4 or more points to georeference an image.
Zoom to the upper right corner and add point then enter longitude and latitude of that location:

Add lat, lon for the image corner.
Add lat, lon for the image corner.

Add another 3 points. Please make sure, that your working diagonally. In our example it would be: upper left, lower right, upper right, lower left. This will minimize problems according to the visibility of the map during georeferencing it.

Georeferencing points added to the image.
Georeferencing points added to the image.

4. Transformation settings

Before we georeference the image please go to Settings and set Transformation settings as shown on the picture below:

Georeference an image - transformation settings
Georeference an image – transformation settings

5. Georeference the image and add it to qGIS map view to check out if everything is fine.  Go to the used crossings of longitudes and latitudes and compare the shown coordinates with the desired coordinates. If they fit, you are done and ready for next step.

6. Before we use the image in Maperitive we need to convert the wld file (created during the georeference process above in the same location as the image) to georef file used by Maperitive.

Make sure that the number of decimal digits for the cell size is not>17 in georef file, otherwise Maperitive will complain.

Conversion of world file (wld) to georef file
Conversion of world file (wld) to georef file

World file content:

0.00012082694840728
0
0
-0.00012226615739132
37.11882655590969193
-2.90009944643156192

georef file content:

<georef>
<srs>
<id>EPSG:4326</id>
</srs>
<origin>
<x>37.11882655590969193
</x>
<y>-2.90009944643156192
</y>
</origin>
<cell-width>0.00012082694840728
</cell-width>
<cell-height>-0.000122266157391
</cell-height>
</georef>

8. Open Maperitive and type command:

clear-map

then

load-image file=Data\kilimanjaro.png background=false 

Maperitive load-image
Maperitive load-image
Georeferenced file loaded to Maperitive
Georeferenced file loaded to Maperitive

9. Generate .mbtiles file – please type the command below changing the zoom levels if necessary:

generate-mbtiles minzoom=0 maxzoom=15

Generate mbtiles
Generate mbtiles

10. rename the generated file to whatever name you want:

rename

11. Copy the file to the device memory card to MapIt->OfflineMaps folder:

phone offlinemaps

12. If you have MapIt offline maps extension your map will be available and ready to use – enjoy…

Offline Map within MapIt app.
Offline Map within MapIt app.

MapPad app is growing

Hi, It’s been a while since I have posted anything. Just to let you know that MapPad project has grown significantly in the past year, lots of new functions have been added and you can get the app demo for free here.

The most recent update includes WMS and ArcGIS Server Tiled services support, you can add your own Google Maps overlay and improve your productivity even more:

http://mappadapp.com/adding-custom-wms-service

http://mappadapp.com/google-maps-overlays

Enjoy 🙂

MapPad – Simple mapping solution for Android devices

Hi guys, check it out – it’s my first app for android devices. I am looking for some comments and feedback, if you work in real estate, forestry, agriculture business – it’s going to help you out. At the moment English, Polish , Portuguese and Italian localisations are available.

I am looking forward to include other languages and need people who can speak particularly Spanish, Chinese, Russian – whatever :).

Visit MapPad website to get more details…

Vincenty formula for distance between two Latitude/Longitude points

Very Nice article about the distance calculation…

Vincenty formula for distance between two Latitude/Longitude points

I encourage you to visit Chris Veness’ Movable Type Ltd. web site to read more very interesting articles.

Add SQL Server view to ArcMap as XY event – Problem resolved

Hi,
In the past week I came acros a problem of displaying X,Y event based on quite complicated, multitables, multiowners query.
Usually I work with Oracle database, however this time I had to pull out the data from SQL Server database.

I have created sucessfully the View, and served the X,Y data as the MapService through the ArcGIS Server – everything was fine until I had to relate another table and the problems jumped out as there was no OBJECTID field presented in the view.

I dig a bit and found a solution of using indexed Views (http://strangenut.com/blogs/dacrowlah/archive/2008/11/26/creating-an-indexed-view-in-sql-server-2005-and-2008.aspx) however in my case I was getting:

"Index cannot be created on view '....View_Ix' because the underlying object '...._origin' has a different owner." – that was probably because I had several tables from different users in my query, anyway…

After few hours of checking diferent things I have discovered that if you use the “Make Query Table” tool from ArcToolBox before you make your XY event layer and specifiy which field to use as a key in that tool, it works just great.

I need to test few things yet – so check if the data is being updated properly in that new table etc, but at the moment everything looks promissing.

I hope that hint will be useful for some of you as well.

CAD to File Geodatabase – Python script

In near feature I am going to work on the project where the CAD conversion to esri format will be required. The script below might be useful…

Syntax:

CADtoGeodatabase_conversion (input_cad_datasets, out_gdb_path, out_dataset_name, reference_scale, {spatial_reference})

input_cad_datasets [CAD drawing dataset,…] – The collection of CAD files to convert to geodatabase features. The input parameter will accept CAD data from multiple formats (DWG, DXF, and DGN) in one operation.

Workspace out_gdb_path – The ArcSDE, file, or personal geodatabase where the Output Feature Dataset will be created. The target geodatabase must already exist.

String out_dataset_name – The name of the feature dataset to be created.

Double reference_scale – Enter the scale to use as a reference for the annotation. This sets the scale to which all symbol and text sizes in the annotation will be made relative.

Spatial Reference spatial_reference – (Optional) The spatial reference of the output feature dataset. If you wish to control other aspects of the spatial reference (i.e., the xy, z, m domains, resolutions, tolerances), use the relevant environments.

Code sample:


#Name: CadtoGeodatabase.py
# Description: Create a feature dataset
# Author: ESRI
# Import system modules
import arcpy
from arcpy import env
# Set workspace
env.workspace = "C:/data"

# Set local variables
input_cad_dataset = "C:/data/City.DWG"
out_gdb_path = "C:/data/HabitatAnalysis.gdb"
out_dataset_name = "analysisresults"
reference_scale = "1000"
spatial_reference = "NAD_1983_StatePlane_California_VI_FIPS_0406_Feet"

# Create a FileGDB for the fds
arcpy.CreateFileGDB_management("C:/data", "HabitatAnalysis.gdb")

# Execute CreateFeaturedataset
arcpy.CadToGeodatabase_conversion(input_cad_dataset, out_gdb_path, out_dataset_name, reference_scale)

References:
Source: ESRI Help
Mapping Specification for DWG/DXF (MSD)

 

OSTN02 in NTv2 Transformation in ArcGIS Desktop

In its original form OSTN02 consists of a plane 700 km by 1250 km grid of 1 km resolution with an eastings shift and northing shift at each grid node.

The plane grid form of OSTN02 is not easily compatible with some GIS systems.  Some of these systems utilise a transformation data format known as NTv2.  NTv2 format is a gridded format but the grid is realised on a latitude/longitude graticule and the shifts are expressed as differences in latitude and longitude.” OS

Ordnance Survey working with Defence Geographic Centre have produced an NTV2 version of their OSTN02 transformation.

To implement the transformation and make it available in ArcGIS Desktop:

1. Download the data file from OS website: http://www.ordnancesurvey.co.uk/business-and-government/help-and-support/navigation-technology/os-net/ostn02-ntv2-format.html

2. Using Windows Explorer, create a new folder called greatbritain (if it doesn’t already exist) using lowercase letters in (On a 64 bit machine this will be in Program Files (x86) ):

  • 9.x – C:\Program Files\ArcGIS\pedata\ntv2\
  • 10.0 – C:\Program Files\ArcGIS\Desktop10.0\pedata\ntv2\

3. Copy the NTv2 grid file(s) to the greatbritain folder. Note: There is no limit to how many  .gsb files you can store in this folder.

4. Download GEOGTRAN.txt file. Paste that file in some folder on the C drive like C:\PEOBJ (please do not put the GEOGTRAN file to the Program Files Folder).Add an Environment Variable of PEOBJEDITHOME to the System Variables with the value of the folder where the GEOGTRAN file will reside  (e.g. C:\PEOBJ ).

When you download and copy the file into the e.g. C:\PEOBJ – please remove the file extension (txt) leaving the file without extension.

The content of GEOGTRAN file is as follow:

GEOGTRAN, 208339, "OSGB_1936_To_WGS_1984_OSTN02_NTV2",
PE_GCS_OSGB_1936, PE_GCS_WGS_1984, PE_MTH_NTV2, PE_PAR_NAME_DATASET,
"Dataset_greatbritain/OSTN02_NTv2"
GEOGTRAN, 208338, "OSGB_1936_To_ETRS_1989_OSTN02_NTV2",
PE_GCS_OSGB_1936, PE_GCS_ETRS_1989, PE_MTH_NTV2,
PE_PAR_NAME_DATASET, "Dataset_greatbritain/OSTN02_NTv2"

5. Open Arc Map and set the Layers projection to Geographic projection OSGB36

6. Add any data projected in OSGB36 (geographic) or cartesian British National Grid.

7. Add ESRI_STREETMAP_World_2D or any other data projected in WGS1984 – do not apply any trasformation:

As you can see there will be the data shift of approximately 100m.

8. Right click on Layers then go to Properties and click Transformation button and select one of the new transformation methods from the drop-down list – in our case it will be OSGB_1936_To_WGS_1984_OSTN02_NTV2:

9. Apply the selected transformation – as you can see the WGS84 data has been properly re-projected to OSGB36 using OSTN02 in NTv2 Transformation method:

The above method is working for ArcGIS Desktop 9.2 to 10.0 – it has been tested and is working fine. If you have any questions please do not hesitate to ask.

Please remember – if you have data in British National Grid (Easting, Northing), you need to project it first to OSGB36 (world projection) to use the method described above.