Thanks! I've been swamped at work so I didn't have any time to write much more documentation than the readme.txt (and that's even wrong).<br><br>Let me know if you need help/features with the rules.txt.<br><br>
<div class="gmail_quote">On Thu, Feb 12, 2009 at 4:22 PM, Sam Vekemans <span dir="ltr"><<a href="mailto:acrosscanadatrails@gmail.com">acrosscanadatrails@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Yuppee!!<div><br></div><div>It worked!. ..</div><div><br></div><div>I created an OSM file!.. </div><div>Now i just need to play around using different shape files, and changing the rules.</div><div><br></div><div>Your awesome!!</div>
<div><br></div><div>I'll get back to you once i figure out some more. ;)</div><div><br></div><div>Look forward to seeing how the tests work out.</div><div><br></div><div>Cheers<br></div><font color="#888888"><div>Sam</div>
</font><div><br></div><div>
P.S. and to talk-ca list, once i figure it out, i'll write it on the Wiki for shp2osm</div><div><div></div><div class="Wj3C7c"><div><br></div><div><br></div><div><br><div class="gmail_quote">On Thu, Feb 12, 2009 at 1:59 PM, Ian Dees <span dir="ltr"><<a href="mailto:ian.dees@gmail.com" target="_blank">ian.dees@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Yes, the standard (or at least the way all the tools I've seen work) is that the .shp and .prj files need to have the same name.<div>
<div></div><div><br><br><div class="gmail_quote">On Thu, Feb 12, 2009 at 3:57 PM, Sam Vekemans <span dir="ltr"><<a href="mailto:acrosscanadatrails@gmail.com" target="_blank">acrosscanadatrails@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Well, I do have the matching .prj file<div>092f04_3_0_BS_2010009_0.prj</div><div>So, I assume that both the .shp and the .prj file needs to have the same name?</div>
<div><br></div><div>Fortunately, i do understand what map "projection" means. :-)</div>
<div><br></div><div><font color="#888888">Sam</font><div><div></div><div><br><br><div class="gmail_quote">On Thu, Feb 12, 2009 at 1:48 PM, Ian Dees <span dir="ltr"><<a href="mailto:ian.dees@gmail.com" target="_blank">ian.dees@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I'm glad you got it to work that far.<br><br>sourceCRS is null because you have no .prj projection file in the same directory as the .shp file, which means it can't reproject the points from whatever projection they're in to the required WGS84. I suppose I could make a switch to turn reprojection off, but it's fairly important to get right, especially on big imports like the one you're doing.<br>
<br>What many-to-many relationship are you talking about?<br><br>This 0.2 version of shp-to-osm should support point features, but I haven't tested it with a point-only shapefile yet.<div><div></div><div>
<br><br><div class="gmail_quote">On Thu, Feb 12, 2009 at 3:44 PM, Sam Vekemans <span dir="ltr"><<a href="mailto:acrosscanadatrails@gmail.com" target="_blank">acrosscanadatrails@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Ok, well it's version 1.6 so thats cool.<div><br></div><div>has the same error </div><div>
<div><span style="border-collapse: collapse;"><div><br></div><div>Exception in thread "main" java.lang.NoClassDefFoundError: Main</div>
<div>Caused by: java.lang.ClassNotFoundExeption: Main</div><div>at java.net.URLClassLoader$1.run<Unknown Source></div><div>at java.security.AccessController.doPrivileged<Native Method></div><div>at java.net.URLClassLoader.findClass<Unknown Source></div>
<div>at java.lang.ClassLoader.loadClass<Unknown Source></div><div>at sun.misc.Launcher$AppClassLoader.loadClass <Unknown Source></div><div>at java.lang.ClassLoader.loadClass<Unknown Source></div><div>at java.lang.ClassLoader.loadClassUnternal<Unknown Source></div>
<div>Could not find the main class: Main. Program will now exit.</div><div><br></div></span></div><div>So i used </div><div>java -cp shp-to-osm-0.2.jar:lib/gt-epsg-wkt-2.5-M3.jar:lib/gt-shapefile-2.5-M3.jar:lib/log4j-1.2.12.jar;lib/gt-epsg-extension-2.5-M3.jar;lib/commons-lang-2.1.jar;lib/jsr-275-1.0-beta-2.jar;lib/jts-1.9.jar;lib/gt-api-2.5-M3.jar;lib/jai_core.jar;lib/gt-metadata-2.5-M3.jar;lib/gt-referencing-2.5-M3.jar;lib/geoapi-2.2-M1.jar;lib/gt-main-2.5-M3.jar Main d:/canvec2osm/watertower.shp d:/canvec2osm/rules.txt d:/canvec2osm/canvec.osm<br>
</div><div><br></div><div>***</div><div>So then i changed the ":" to a ";" that seemed to work.</div><div>It choked just after </div><div><br></div><div>Converting from null to GEOGCS[WGS 84",</div>
<div>....7 lines</div><div>Authority["EPSG","4326"]]</div><div><br></div>It says the Argument "sourceCRS" should not be null..</div><div><br></div><div>***</div><div>Im going to try it using different shape files, as you said it doesnt work with shape files that are just points.</div>
<div>..</div><div><br></div><div>Happy I got that far, :)</div><div><br></div><div>So anyway,</div><div>John Peterson Is also working on a script (latest talk-ca list), which deals with the many-to-many relationship, where im trying to get the "ignore what else is there, and just import the shape"</div>
<div><br></div><div>Since i uncovered this new onion layer, are there any jar files that the program can work without?</div><div><br></div><div>Thanks,</div><div>Sam</div><div><div></div><div><div><br><div class="gmail_quote">
On Thu, Feb 12, 2009 at 12:45 PM, Ian Dees <span dir="ltr"><<a href="mailto:ian.dees@gmail.com" target="_blank">ian.dees@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">None of those things will cause the error you are seeing.<br><br>Try these exact steps please:<br>
<br>1. Open a command prompt via Start > Run... "cmd"<br>
2. Use "cd" to change directory to the directory that contains the shp-to-osm-0.2.jar file. This directory should have been created when you expanded the .zip you downloaded from my website. It should have the "lib" directory in it.<br>
3. Type "java -version". You should see a short (3 line) output. One line should contain the version of java which should be at least 1.5.<br>4. Then, copy and paste the following command into the cmd.exe window:<div>
<br>
<br>java -cp shp-to-osm-0.2.jar:lib/gt-epsg-wkt-2.5-M3.jar:lib/gt-shapefile-2.5-M3.jar:lib/log4j-1.2.12.jar;lib/gt-epsg-extension-2.5-M3.jar;lib/commons-lang-2.1.jar;lib/jsr-275-1.0-beta-2.jar;lib/jts-1.9.jar;lib/gt-api-2.5-M3.jar;lib/jai_core.jar;lib/gt-metadata-2.5-M3.jar;lib/gt-referencing-2.5-M3.jar;lib/geoapi-2.2-M1.jar;lib/gt-main-2.5-M3.jar Main <path to input shapefile> <path to rules file> <path to output osm file><br>
<br></div>And then (if it doesn't work), copy the exact output from the command prompt, and paste it in an e-mail back to me.<div><div></div><div><br><br><div class="gmail_quote">On Thu, Feb 12, 2009 at 2:20 PM, Sam Vekemans <span dir="ltr"><<a href="mailto:acrosscanadatrails@gmail.com" target="_blank">acrosscanadatrails@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Dout, A little googling is supposed to FIND the answer, yet it made me more confused. :)<div>
That switch didn't work, unfortunatly. .. however, a few things that might help.</div><div>Each time i logged off and shut down the computer, i got the error "WJView.exe" (or something like that) - file not responding, so i just hit 'end now' it's always anoying.</div>
<div><br></div><div>The problem could be this;</div><div>When windows or myself updates to a new java version, it doesnt wipe out the old java version, so to remove the access waste. (unneeded files) so when running the script, it calls on an old version of java?</div>
<div><br></div><div>It tells me that i have "Java Quick Starter" running, as part of the msconfig.sys, is this similar to "javaw.exe" or "WJView.exe"</div><div><div><br></div><div>BTW (Im using an EEE pc with windows XP) if that helps.</div>
<div><br></div><div>Thanks,</div><div>Sam<div><div></div><div><br><br><div class="gmail_quote">On Thu, Feb 12, 2009 at 5:23 AM, Ian Dees <span dir="ltr"><<a href="mailto:ian.dees@gmail.com" target="_blank">ian.dees@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
It looks like I copied the wrong command to you. Please try the following:<br><br>java -cp shp-to-osm-0.2.jar:lib/gt-<div><div>epsg-wkt-2.5-M3.jar:lib/gt-shapefile-2.5-M3.jar:lib/log4j-1.2.12.jar:lib/gt-epsg-extension-2.5-M3.jar:lib/commons-lang-2.1.jar:lib/jsr-275-1.0-beta-2.jar:lib/jts-1.9.jar:lib/gt-api-2.5-M3.jar:lib/jai_core.jar:lib/gt-metadata-2.5-M3.jar:lib/gt-referencing-2.5-M3.jar:lib/geoapi-2.2-M1.jar:lib/gt-main-2.5-M3.jar Main <path to input shapefile> <path to rules file> <path to output osm file><br>
<br></div>This time, the correct version of the shp-to-osm jar is in the command line (last time it was 0.1, this time 0.2).<br></div><div><div></div><div><br><br><div class="gmail_quote">On Thu, Feb 12, 2009 at 1:23 AM, Sam Vekemans <span dir="ltr"><<a href="mailto:acrosscanadatrails@gmail.com" target="_blank">acrosscanadatrails@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div>Interesting, </div><div>it says;</div><div><br></div><div>Exception in thread "main" java.lang.NoClassDefFoundError: Main</div>
<div>Caused by: java.lang.ClassNotFoundExeption: Main</div><div>at java.net.URLClassLoader$1.run<Unknown Source></div>
<div>at java.security.AccessController.doPrivileged<Native Method></div><div>at java.net.URLClassLoader.findClass<Unknown Source></div><div>at java.lang.ClassLoader.loadClass<Unknown Source></div><div>at sun.misc.Launcher$AppClassLoader.loadClass <Unknown Source></div>
<div>at java.lang.ClassLoader.loadClass<Unknown Source></div><div>at java.lang.ClassLoader.loadClassUnternal<Unknown Source></div><div>Could not find the main class: Main. Program will now exit.</div><div><br>
</div><div>....</div><div>So it looks like it didn't like the 'Main' key, </div><div>I tried those different combinations, which didn't work either.</div><div><br></div>It's probably the 'rules.txt. as the file im using uses a number system for each map feature as it's map type.<div>
.. I just figured out how to add in other fields in the shape file. </div><div>What specific fields are needed for the shape file to work?</div><div><br></div><div><br></div><div>Hope that helps,</div><div>Sam<div><div>
</div><div><br><br><div class="gmail_quote">
On Wed, Feb 11, 2009 at 9:50 PM, Ian Dees <span dir="ltr"><<a href="mailto:ian.dees@gmail.com" target="_blank">ian.dees@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Yes, that should be fine. Make sure you're running the following command:<br><br>java -cp shp-to-osm-0.1.jar:lib/gt-epsg-wkt-2.5-M3.jar:lib/gt-shapefile-2.5-M3.jar:lib/log4j-1.2.12.jar:lib/gt-epsg-extension-2.5-M3.jar:lib/commons-lang-2.1.jar:lib/jsr-275-1.0-beta-2.jar:lib/jts-1.9.jar:lib/gt-api-2.5-M3.jar:lib/jai_core.jar:lib/gt-metadata-2.5-M3.jar:lib/gt-referencing-2.5-M3.jar:lib/geoapi-2.2-M1.jar:lib/gt-main-2.5-M3.jar Main <path to input shapefile> <path to rules file> <path to output osm file><br>
<br>(This is slightly different than the readme: the readme.txt is missing the "Main" after the list of jars for the classpath)<br><br>Some tips:<br>1. The above command assumes you are starting it in the directory that contains "shp-to-osm-0.2.jar" and the "lib" directory.<br>
2. If there are spaces in your shapefile, rules, or output file paths, you need to put quotes around the path.<br>3. Try using / instead of \ for windows paths.<br><br>If that doesn't work, let me know. Send me the exact message you get.<div>
<div></div><div><br>
<br><div class="gmail_quote">On Wed, Feb 11, 2009 at 11:40 PM, Sam Vekemans <span dir="ltr"><<a href="mailto:acrosscanadatrails@gmail.com" target="_blank">acrosscanadatrails@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Cool, thats the one that's called <div>shp-to-osm-0.2 right?</div><div><br></div><div>It looks like i just need to change the 'rules.txt' file</div><div><br></div><div>Then, does it matter what format the shp file is in?</div>
<div><br></div><div>Does it matter if it's on the C: drive or D: drive?</div><div>"D:\canvec2osm\canvec.shp" </div><div>if all the jar files are in the d:\canvec2osm\lib</div><div>and the rules file is in the </div>
<div>d:\canvec2osm\rules.txt</div><div><br></div><div>im not sure why it doesn't work.</div><div><br></div><div>Thanks,</div><div>Sam</div><div><div></div><div><div><br><br><div class="gmail_quote">On Wed, Feb 11, 2009 at 8:13 PM, Ian Dees <span dir="ltr"><<a href="mailto:ian.dees@gmail.com" target="_blank">ian.dees@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">The links you give are not the file I am linking to. The file you're looking at is a Python script, the file I wrote is a Java application.<div>
<div></div><div><br><br><div class="gmail_quote">On Wed, Feb 11, 2009 at 10:12 PM, Sam Vekemans <span dir="ltr"><<a href="mailto:acrosscanadatrails@gmail.com" target="_blank">acrosscanadatrails@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Thanks,<div>Ya, thats the one i am looking at. Unfortunately i can't figure it out :)</div>
<div>as it doesn't recognize the shape files im using. (needs to be converted to the write type of shape file.</div><div>
...</div><div>Im looking at</div><div><a href="http://article.gmane.org/gmane.comp.gis.openstreetmap/32835" target="_blank">http://article.gmane.org/gmane.comp.gis.openstreetmap/32835</a></div><div><br></div><div>as it has a little more detail instruction, but still a bit complex. ;-)</div>
<div><br></div><div>I created a wiki so to share the instructions</div><div><a href="http://wiki.openstreetmap.org/wiki/Shp2osm" target="_blank">http://wiki.openstreetmap.org/wiki/Shp2osm</a><br></div><div><br></div><div>
I also see a blog post</div>
<div><a href="http://crschmidt.net/blog/354/polyshp2osm/" target="_blank">http://crschmidt.net/blog/354/polyshp2osm/</a></div><div><br></div><div>So I think it's work creating a wiki page with a little more concrete description. It was created for the MassGIS import and used for others, but i think that the basic script could be written which would include discribing how to edit the script to work to convert a shape to an OSM shape.</div>
<div><br></div><div>I still need to go through it in detail, so I'll copy the instructions that i find on the pages. But first I'll wait i hear from you.</div><div><br></div><div>Cheers,</div><div>Sam</div><div>
<div></div><div><div><br>
<br><div class="gmail_quote">On Wed, Feb 11, 2009 at 7:21 PM, Ian Dees <span dir="ltr"><<a href="mailto:ian.dees@gmail.com" target="_blank">ian.dees@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="gmail_quote"><div><div></div><div>On Wed, Feb 11, 2009 at 6:35 PM, Sam Vekemans <span dir="ltr"><<a href="mailto:acrosscanadatrails@gmail.com" target="_blank">acrosscanadatrails@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi, wondering if there is any progress on the script?<br>
I'm looking to make the wiki more simpiler to show the process.<br>
I downloaded python, but im lost as to how to make it work.</blockquote></div></div><div><br>There are a couple others, but take a look at my Java app here:<br><br> <a href="http://redmine.yellowbkpk.com/projects/list_files/geo" target="_blank">http://redmine.yellowbkpk.com/projects/list_files/geo</a><br>
<br>You can use it to convert shapefiles to osm. There is a readme included in the zip file.<br></div></div>
</blockquote></div><br></div>
</div></div></blockquote></div><br>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div><br>
</div></div></blockquote></div><br></div></div></div>
</blockquote></div><br>
</div></div></blockquote></div><br></div></div></div></div>
</blockquote></div><br>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div><br>
</div></div></blockquote></div><br></div></div></div>
</blockquote></div><br>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div><br>