Skip to content

FGDC reader horizontalPlanar uncaught exception #245

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
chris-macdermaid opened this issue May 24, 2023 · 2 comments
Open

FGDC reader horizontalPlanar uncaught exception #245

chris-macdermaid opened this issue May 24, 2023 · 2 comments

Comments

@chris-macdermaid
Copy link
Collaborator

chris-macdermaid commented May 24, 2023

Running version 2.17.1 and 2.18.1 causes an uncaught exception. FGDC XML is attached as a txt file.

image

Running it locally shows the following error

mdtranslator translate Congressional-Districts-20230523.xml -r fgdc -w iso19115_2

mdTranslator/lib/adiwg/mdtranslator/readers/fgdc/modules/module_horizontalPlanar.rb:59:in `unpack': undefined method `empty?' for nil:NilClass (NoMethodError)

              unless hProjection.empty?
                                ^^^^^^^
from mdTranslator/lib/adiwg/mdtranslator/readers/fgdc/modules/module_horizontalReference.rb:35:in `block in unpack'
from .rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/nokogiri-1.15.0-x86_64-linux/lib/nokogiri/xml/node_set.rb:235:in `block in each'
from .rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/nokogiri-1.15.0-x86_64-linux/lib/nokogiri/xml/node_set.rb:234:in `upto'
from .rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/nokogiri-1.15.0-x86_64-linux/lib/nokogiri/xml/node_set.rb:234:in `each'
from mdTranslator/lib/adiwg/mdtranslator/readers/fgdc/modules/module_horizontalReference.rb:34:in `unpack'
from mdTranslator/lib/adiwg/mdtranslator/readers/fgdc/modules/module_spatialReference.rb:24:in `unpack'
from mdTranslator/lib/adiwg/mdtranslator/readers/fgdc/modules/module_fgdc.rb:86:in `unpack'
from mdTranslator/lib/adiwg/mdtranslator/readers/fgdc/fgdc_reader.rb:48:in `readFile'
from mdTranslator/lib/adiwg/mdtranslator/readers/mdReaders.rb:40:in `handleReader'
from mdTranslator/lib/adiwg/mdtranslator.rb:163:in `translate'
from mdTranslator/lib/adiwg/mdtranslator_cli.rb:83:in `translate'
from .rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/thor-1.2.2/lib/thor/command.rb:27:in `run'
from .rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/thor-1.2.2/lib/thor/invocation.rb:127:in `invoke_command'
from .rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/thor-1.2.2/lib/thor.rb:392:in `dispatch'
from .rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/thor-1.2.2/lib/thor/base.rb:485:in `start'
from mdTranslator/bin/mdtranslator:9:in `<top (required)>'
from .rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/bin/mdtranslator:25:in `load'
from .rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/bin/mdtranslator:25:in `<top (required)>'
from .rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/bundler-2.4.13/lib/bundler/cli/exec.rb:58:in `load'
from .rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/bundler-2.4.13/lib/bundler/cli/exec.rb:58:in `kernel_load'
from .rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/bundler-2.4.13/lib/bundler/cli/exec.rb:23:in `run'
from .rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/bundler-2.4.13/lib/bundler/cli.rb:492:in `exec'
from .rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/bundler-2.4.13/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
from .rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/bundler-2.4.13/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
from .rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/bundler-2.4.13/lib/bundler/vendor/thor/lib/thor.rb:392:in `dispatch'
from .rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/bundler-2.4.13/lib/bundler/cli.rb:34:in `dispatch'
from .rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/bundler-2.4.13/lib/bundler/vendor/thor/lib/thor/base.rb:485:in `start'
from .rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/bundler-2.4.13/lib/bundler/cli.rb:28:in `start'
from .rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/bundler-2.4.13/exe/bundle:45:in `block in <top (required)>'
from .rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/bundler-2.4.13/lib/bundler/friendly_errors.rb:117:in `with_friendly_errors'
from .rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/bundler-2.4.13/exe/bundle:33:in `<top (required)>
@chris-macdermaid
Copy link
Collaborator Author

@chris-macdermaid chris-macdermaid changed the title FGDC reader horizontalPlanar fatal exception FGDC reader horizontalPlanar uncaught exception May 24, 2023
@dwalt
Copy link
Collaborator

dwalt commented May 25, 2023

I believe the horizontal projection is incorrectly coded for CSDGM. You must choose from the standard projection domain, and provide the requisite parameters, or, if you are defining a custom projection (free form projection name), then you must describe the projection parameters in "otherprj" as free form text. Also, the coordinate system encoding, units and coordinate resolution must be defined. An example text file is enclosed: (https://github.com/adiwg/mdTranslator/files/11560791/WebMapMercatorAuxSphere.txt)

This is a custom Mercator projection used in ESRI applications. The parameters for this projection can be found here: https://desktop.arcgis.com/en/arcmap/latest/map/projections/mercator.htm
[WebMapMercatorAuxSphere.txt]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants