[OSGeo-Discuss] Call for help: GDAL and txt2shp.py

Fawcett, David David.Fawcett at state.mn.us
Tue Jul 8 06:14:56 PDT 2008


Kjell, 
 
For ease of setup, I definitely recommend using William Kyngesburye's
binaries found at:  http://www.kyngchaos.com/
<http://www.kyngchaos.com/>  with your system Python.  It gives you a
lot of OS GIS tools, and they just work.  
 
If you are looking for a python module to read the EXIF data, I
recommend EXIF.py.  You can find it at
http://sourceforge.net/projects/exif-py/
<http://sourceforge.net/projects/exif-py/> 
 
I put together a python module for roughly georeferencing air photos
based on EXIF data.  You might be able to harvest something useful out
of there.  The module is called imageplop, I also have an example script
that I use to call it and glue everything together.  
 
You can find the scripts at:
http://code.google.com/p/flatlandmaps/source/browse/trunk/imageplop.py
<http://code.google.com/p/flatlandmaps/source/browse/trunk/imageplop.py>

http://code.google.com/p/flatlandmaps/source/browse/trunk/osGetImagedata
.py
<http://code.google.com/p/flatlandmaps/source/browse/trunk/osGetImagedat
a.py> 
 
If you want to play with it, I put a zip file containing sample data
at:  http://www.flatlandmaps.com/lab/data/sampleData.zip
<http://www.flatlandmaps.com/lab/data/sampleData.zip>   The archive
contains several air photos that include GPS data in their EXIF
headers, and a geotiff elevation grid clipped to the area.  The photos
are from two different flight lines.
 
Let me know if you have any questions about pulling EXIF data from
images and using it to build shapefiles.  
 
David.


	-----Original Message-----
	From: discuss-bounces at lists.osgeo.org
[mailto:discuss-bounces at lists.osgeo.org] On Behalf Of Kjell Are Refsvik
	Sent: Monday, July 07, 2008 6:54 PM
	To: OSGeo Discussions
	Subject: Re: [OSGeo-Discuss] Call for help: GDAL and txt2shp.py
	
	

	On 7. juli. 2008, at 23.54, Dane Springmeyer wrote:

			...Well, given my completely newbie status as a
GIS/Geodata user, I am very grateful for your patience, explaining these
things to me.



		no problem. Please do consider consulting the mailing
lists of the specific software that you are using as well.


	Sorry about the lack of background info. 

	I am on a MacOS X 10.5.2 and have downloaded the latest version
of Perl and Python and all the dependencies needed to run the gdal
package.

	As mentioned earlier, my goal is to set up a basic workflow to
do a mashup between shapefiles that I have, and geodata inside jpeg
files collected with a garmin gpx file and injected using gpsbabel. 

	As a non-programmer, and short on time, I am really hoping to be
able to tie together existing software (like txt2shp.py) and do some
easy basic shell-scripting to get this to work.

	Going into this, I was hoping that I would come across some sort
of swiss army knife style software (like exiftool or gpsbabel) that
would let me add mashup-data to an existing shapefile and convert files
to web-compliant formats. Seems like 


		...
		Okay. Well that graphic is nice and simple. However,
getting there through automation will be not be as easy as using Qgis to
layout you map graphics and then exporting them into another design
program like Scribus, Inkscape, or the GIMP to do your photo layout.


	Darn. I seem to be forced into setting up a complete map server
to do this? Automation is kinda the whole deal of this part of my
thesis. 

	For those of you wondering what the purpose of all of this is,
my thesis is about exploring technical challenges and opportunities as
they related to digital photographs. As the implementation goes, the
argument behind not simply using a classic Google Maps mashup has to do
with longevity/preservation and the fact that I want to make web
publishable albums that tries to relate to as simple/few/standard
elements as possible to be accessible far into the future.  


		I'm assuming that you want to do this with desktop based
tools. 


	Yes.


		If you are up for installing apache 


	already a part of my Mac OS X installation.


		then you could utilize a variety of web based toolkits
to automate the generation of the map graphic and the photo layout. I'd
look into Openlayers and Geoserver (in addition to Mapserver and
Mapnik), and any web framework with a powerful templating engine like
django.


	Hm... Sounds like an extensive solution that requires a lot of
work. I would love to know more about how accessible these technologies
are. I am just afraid that I am looking at 4-8 weeks of installing and
figuring out how these solutions work, only to find out that I need to
learn Python and Ruby to get it to work?

	Yes. I know what you're saying (and I am always telling myself -
don't shy away from something just because it looks complicated, but I
am really hoping to finish my thesis in september :-), and my coding
this solution is simply icing on the cake in terms of the weight it
carries in my thesis.


		If you want to stick to the desktop Mapserver and Mapnik
do have the ability to create map graphics on the command line, but it's
not as simple as automating the conversion of a shapefile to png. You
need to style and label your shapefile data of points along with basemap
data. Therefore you will be looking to render multiple layers into a
single raster png.  Shp2img of the mapserver project or a the use of
mapnik python bindings will be able to do this without resorting to
installing and setting up a webserver, but you'll still need to create a
MAPFILE that defines the styling and labeling.


	Great. So any estimate on the time needed to get to grips with
these things?


		...
		No, shp2img needs a MAPFILE as input (the mapfile points
to your shapefile(s) - or other datasources - and tells mapserver how to
render them):

	
http://mapserver.gis.umn.edu/docs/reference/utilityreference/shp2img


	I see. So basically - no way around installing a mapserver then
:-)


		I'd recommend looking into the QGIS "Export to
mapserver" plugin as well.


	OK. 


		Mapnik can use an XML based MAPFILE, but has no command
line utility to generate a png from the MAPFILE, but simple script
examples can be found here:

		http://trac.mapnik.org/wiki/XMLGettingStarted#Step2


	OK. On to install the mapserver then, and to read up on the
supplied url. 


				
				Dane


			Any idea on the complexity in getting the above
scripting to work?



		Not too complex, but you will need to read up on how to
create a MAPFILE.


	Will dive in and see what happens. 

	Kjell Are





			Sincerely,

			Kjell Are Refsvik
			Norway

			_______________________________________________
			Discuss mailing list
			Discuss at lists.osgeo.org
			http://lists.osgeo.org/mailman/listinfo/discuss
			


		_______________________________________________
		Discuss mailing list
		Discuss at lists.osgeo.org
		http://lists.osgeo.org/mailman/listinfo/discuss
		


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/discuss/attachments/20080708/c5dfde74/attachment-0002.html>


More information about the Discuss mailing list