faridprog / regionator

Automatically exported from code.google.com/p/regionator
0 stars 0 forks source link

nv-roads ex fails to build #8

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. get build 418 of nv-roads in regionator
2. execute extract-streets-kml (output kml is good, views in GE)
3. execute parse-streets-kml (error)

What is the expected output? What do you see instead?

Traceback (most recent call last):
  File "./parse-streets-kml.py", line 115, in ?
    main()
  File "./parse-streets-kml.py", line 90, in main
    street_type = GetStreetTypeFromDescription(description)
  File "./parse-streets-kml.py", line 41, in GetStreetTypeFromDescription
    return r.group(1)
AttributeError: 'NoneType' object has no attribute 'group'

What version of the product are you using? On what operating system?

GDAL 1.4
Python 2.5.1
Mac OS 10.4.8 

Please provide any additional information below.

Original issue reported on code.google.com by brian.da...@gmail.com on 28 Jul 2007 at 5:02

GoogleCodeExporter commented 8 years ago
Can you copy-paste the first <Placemark> from the generated streets.kml? (It's 
mostly
the <descrption> I want to see.)

Original comment by regiona...@gmail.com on 1 Aug 2007 at 4:28

GoogleCodeExporter commented 8 years ago
  <Placemark>
    <description><![CDATA[
      FNODE_: <i>1</i><br />
      TNODE_: <i>2</i><br />
      LPOLY_: <i>0</i><br />
      RPOLY_: <i>0</i><br />
      LENGTH: <i>161.49782</i><br />
      STREETS_: <i>1</i><br />
      STREETS_ID: <i>1</i><br />
      DISPLAYNAM: <i>BRUNSWICK BEACH RD</i><br />
      NAME: <i>BRUNSWICK BEACH</i><br />
      TYPE: <i>RD</i><br />
      L_F_ADD: <i>43</i><br />
      L_T_ADD: <i>60</i><br />
      R_F_ADD: <i>0</i><br />
      R_T_ADD: <i>0</i><br />
      ADDRTYPE_L: <i>C</i><br />
      ADDRTYPE_R: <i>N</i><br />
      COMMUNITY: <i>LIONS BAY</i><br />
      FDMID: <i>1</i><br />
      CLASSIFICA: <i>LOCAL</i><br />
      SITE: <i>99</i><br />
   ]]></description>     
<LineString><coordinates>-123.243336942987455,49.47317989119037,0
-123.243415676493555,49.473409692370623,0 
-123.243339878768694,49.473985818169211,0
-123.243136957541751,49.474610934517692,0</coordinates></LineString>
  <Style><LineStyle><color>ff0000ff</color></LineStyle> 
<PolyStyle><fill>0</fill></PolyStyle></Style>
  </Placemark>
----
anything called a TYPE in that file:

      ADDRTYPE_L: <i>"O</i><br />
      ADDRTYPE_L: <i>C</i><br />
      ADDRTYPE_L: <i>E</i><br />
      ADDRTYPE_L: <i>N</i><br />
      ADDRTYPE_L: <i>O</i><br />
      ADDRTYPE_L: <i>c</i><br />
      ADDRTYPE_L: <i>e</i><br />
      ADDRTYPE_L: <i>o</i><br />
      ADDRTYPE_R: <i>"E</i><br />
      ADDRTYPE_R: <i>C</i><br />
      ADDRTYPE_R: <i>E</i><br />
      ADDRTYPE_R: <i>N</i><br />
      ADDRTYPE_R: <i>O</i><br />
      ADDRTYPE_R: <i>c</i><br />
      ADDRTYPE_R: <i>e</i><br />
      ADDRTYPE_R: <i>o</i><br />
      TYPE: <i>AVE</i><br />
      TYPE: <i>BLVD</i><br />
      TYPE: <i>CLOSE</i><br />
      TYPE: <i>COURT</i><br />
      TYPE: <i>CRES</i><br />
      TYPE: <i>CRT</i><br />
      TYPE: <i>DR</i><br />
      TYPE: <i>HILL</i><br />
      TYPE: <i>HWY</i><br />
      TYPE: <i>LANE</i><br />
      TYPE: <i>OFFRAMP</i><br />
      TYPE: <i>ONRAMP</i><br />
      TYPE: <i>PK</i><br />
      TYPE: <i>PKWY</i><br />
      TYPE: <i>PL</i><br />
      TYPE: <i>POINT</i><br />
      TYPE: <i>RAMP</i><br />
      TYPE: <i>RD</i><br />
      TYPE: <i>ROW</i><br />
      TYPE: <i>ST</i><br />
      TYPE: <i>TRAIL</i><br />
      TYPE: <i>WALK</i><br />
      TYPE: <i>WAY</i><br />
      TYPE: <i>WYND</i><br />

Original comment by brian.da...@gmail.com on 1 Aug 2007 at 6:09

GoogleCodeExporter commented 8 years ago
all CLASSIFICA from the streets.kml

      CLASSIFICA: <i>ACCESS</i><br />
      CLASSIFICA: <i>COLLECTOR</i><br />
      CLASSIFICA: <i>HIGHWAY</i><br />
      CLASSIFICA: <i>LANE</i><br />
      CLASSIFICA: <i>LOCAL</i><br />
      CLASSIFICA: <i>MAJOR</i><br />
      CLASSIFICA: <i>MINOR</i><br />
      CLASSIFICA: <i>PRIVATE</i><br />

Original comment by brian.da...@gmail.com on 1 Aug 2007 at 6:25

GoogleCodeExporter commented 8 years ago
it suspect it is something about Python, because I ran this under Komodo 
debugger and
it worked ?? I ran it on the command line on the unchanged data file, and it
generates the AttributeError. ???

Original comment by brian.da...@gmail.com on 1 Aug 2007 at 5:19

GoogleCodeExporter commented 8 years ago
Sounds fishy, yep. I went so far as to build my own Python2.5.1, but I can't 
repro
your error. If you get to the bottom of it, please do share the wisdom. 

Original comment by regiona...@gmail.com on 1 Aug 2007 at 6:27

GoogleCodeExporter commented 8 years ago
kml.kmlparse.GetSimpleElementText(placemark, 'description') 
  is returning an empty string

Original comment by brian.da...@gmail.com on 1 Aug 2007 at 9:17

GoogleCodeExporter commented 8 years ago
Still can't repro. I zipped my extracted streets.kml and checked it in:
http://regionator.googlecode.com/svn/trunk/nv-roads/zipped-streets-kml.zip

Can you unzip and diff it against your own? Every placemark has a non-null 
description, so 
GetSimpleElementText shouldn't be failing.

Original comment by mtj.ashb...@gmail.com on 4 Aug 2007 at 7:43

GoogleCodeExporter commented 8 years ago
ok, I diff'd the streets.kml
for whatever reasons, the coordinates differ after the 3rd decimal

however, the important thing is that all of my descriptions are there and seem 
to match

I think the point is that GetSimpleElementText() is behaving badly, not that 
the data
is being mangled... no answer yet.. (may be out of my reach as I am not a 
PYTHON heavy)

Original comment by brian.da...@gmail.com on 5 Aug 2007 at 4:18