Skip to content

TypeError raised in the create_instance management command when passing a --geojson argument #3170

@jwalgran

Description

@jwalgran
  • Save the JSON below as pa.json and make it available on the app VM.
  • Run the create instance command
./manage.py create_instance geojsontest --url_name=geojsontest --user={your-username} --geojson=/path/to/pa.json

A TypeError is thrown

Traceback (most recent call last):
  File "manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 354, in execute_from_command_line
    utility.execute()
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 346, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 394, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 445, in execute
    output = self.handle(*args, **options)
  File "/usr/local/lib/python2.7/dist-packages/django/utils/decorators.py", line 145, in inner
    return func(*args, **kwargs)
  File "/usr/local/otm/app/opentreemap/treemap/management/commands/create_instance.py", line 80, in handle
    geom = GEOSGeometry(open(options['geojson'], srid=4326).read())
TypeError: 'srid' is an invalid keyword argument for this function


pa.json

{
    "type": "MultiPolygon",
    "coordinates": [[
        [
            [
                -80.947265625,
                39.30029918615029
            ],
            [
                -73.740234375,
                39.30029918615029
            ],
            [
                -73.740234375,
                42.61779143282346
            ],
            [
                -80.947265625,
                42.61779143282346
            ],
            [
                -80.947265625,
                39.30029918615029
            ]
        ]
    ]]
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions