Browse files

Merged branches, added TODO notes and more information to the README

  • Loading branch information...
1 parent 76006a2 commit 29bd26f0c30ba6329bf89d2aced4ad5575b1ab26 @wildintellect committed Apr 17, 2012
Showing with 33 additions and 5 deletions.
  1. +28 −4
  2. BIN images/robinson_30d_compare.png
  3. +5 −1
@@ -1,12 +1,31 @@
Python script to generate a graticule that will project cleanly (with smooth arcs) at world scale. The graticule should have a dense distribution of internal nodes along it's line, especially along the ±180, ±90 WGS84 bounding box.
-Output format is geojson, because it's easy to write as a text file in python. Use ogr2ogr to convert to a SHP file.
+Script was originally written as a demonstration for students in Intro to GIS programming with python. Output format is geojson, because it's easy to write as a text file in python. Use ogr2ogr to convert to a SHP file.
By **Alex Mandel** Copyright 2012.
Modifications by Nathaniel Vaughn KELSO.
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ See the License for the specific language governing permissions and
+ limitations under the License.
`python -s 1 -o outfile.geojson`
@@ -22,6 +41,8 @@ There are two script arguments for controlling the density of nodes and the outp
* The output is a GeoJSON format file, not a SHP format Esri Shapefile.
+* Graticule is created in local coordinates (purely numeric).
## Examples
When we project out of WGS84 to another coordinate system that is not cylindrical, we need to have enough intermediate nodes
@@ -30,12 +51,15 @@ so we need to add these extra nodes in the raw geodata.
Here we see Robinson using enough nodes:
-![Zoom previews](
+![Zoom previews](
Box results when nodes are sparse:
-![Zoom previews](
+![Zoom previews](
The two superimposed:
-![Zoom previews](
+![Zoom previews](
+Comparison to QGIS graticule creator which only makes nodes where lines intersect:
+![Zoom previews](
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -21,6 +21,8 @@
import os, stat
from optparse import OptionParser
+#TODO: Take bounding box as arg for setting range
parser = OptionParser(usage="""%prog [options]
Generates a GeoJSON file with graticules spaced at specified interval.""")
@@ -31,6 +33,7 @@
parser.add_option('-o', dest='outfilename', default='',
help='Output filename (with or without path), defaults to "graticule_1dd.geojson".')
+#TODO: Implement python OGR writing for multiple output format support.
#parser.add_option('-p', '--shp', dest='shapefile', default=False, type='boolean",
# help='Output a SHP file, defaults to False and requires ORG/GDAL.')
@@ -39,6 +42,7 @@
#set the stepping of the increment, converting from string to interger
+#TODO: Calculate a node density based on the bounding box and interval defined by the user
step = options.step_interval
# destination file
out_file = options.outfilename
@@ -137,4 +141,4 @@
# try:
# ogr2ogr -f "ESRI Shapefile" out_file out_file
# except:
-# pass
+# pass

0 comments on commit 29bd26f

Please sign in to comment.