Skip to content

Commit

Permalink
The full path to the file being prepared is now passed to the prep cl…
Browse files Browse the repository at this point in the history
…ass.

Previously only the file name without the path was provided.

This allows the prep class to use components of the path and any
file system attributes that it requires.
  • Loading branch information
walkermatt committed Jul 28, 2012
1 parent f0760e5 commit 9118e4c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions python/prep_osgml.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,9 @@ def _add_fid_elm(self, feat_elm):

def _add_filename_elm(self, feat_elm):

# Create an element with the fid
# Create an element with the filename
elm = etree.SubElement(feat_elm, "filename")
elm.text = self.inputfile
elm.text = os.path.basename(self.inputfile)

return feat_elm

Expand Down
2 changes: 1 addition & 1 deletion python/prepgml4ogr.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ def main():
except IndexError:
pass
prep_class = get_preparer(prep_class)
preparer = prep_class(os.path.basename(inputfile))
preparer = prep_class(inputfile)

parser = make_parser()
parser.setContentHandler(gmlhandler(preparer))
Expand Down
3 changes: 3 additions & 0 deletions readme.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ Some configuration examples are available on the [project wiki](https://github.c
* Document the available tokens that can be used in the ogr_cmd, post_cmd
* Using an alternative Python interpretor with OSGeo4W by specifying PYTHONHOME and the full path to the interpretor on Windows

* loader.py
* Add exception and message when source data is not found

* OS MasterMap ITN
* Test load on national cover
* PostgreSQL scripts to join it all up

0 comments on commit 9118e4c

Please sign in to comment.