Default zoom level in web treemap

13 views
Skip to first unread message

treema...@gmail.com

unread,
Jul 17, 2017, 1:40:49 PM7/17/17
to opentreemap-user
Hi all, when creating a new treemap, we tried to configure it to cover all country area with a specific zoom, but we got a map that cover a region and we can not add tree outside it.
Please what is the maximum area surface that can cover a treemap and can we set a default zoom level to the web map
Thanks

Michael Maurizi

unread,
Jul 17, 2017, 1:47:50 PM7/17/17
to opentreemap-user
The zoom level is defined by the region associated with the treemap (which also controls where trees can be added, as you discovered)

You can set the region boundaries by providing a GeoJSON file containing the boundaries as the --geojson parameter of the create_instance management command.

--
You received this message because you are subscribed to the Google Groups "opentreemap-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to opentreemap-us...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--

Michael Maurizi, Software Developer
Azavea |  990 Spring Garden, 5th Floor, Philadelphia, PA
mmau...@azavea.com | Web azavea.com  |  @azavea

treema...@gmail.com

unread,
Jul 17, 2017, 6:49:51 PM7/17/17
to opentreemap-user
Thank you for your response, do you have please any correct example for this json file

Justin Walgran

unread,
Jul 18, 2017, 1:44:22 PM7/18/17
to opentree...@googlegroups.com
Here is an example of a simple rectangle around the state of Pennsylvania. The GeoJSON must use the MultiPolygon type and use unprojected lat/lng coordinates.

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


--
You received this message because you are subscribed to the Google Groups "opentreemap-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to opentreemap-user+unsubscribe@googlegroups.com.

treema...@gmail.com

unread,
Jul 18, 2017, 2:22:58 PM7/18/17
to opentreemap-user
I always got this error, any idea please:

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


On Monday, July 17, 2017 at 6:40:49 PM UTC+1, treema...@gmail.com wrote:

Justin Walgran

unread,
Jul 18, 2017, 2:51:46 PM7/18/17
to opentree...@googlegroups.com
This looks like a bug in the create_instance command. I opened a new issue https://github.com/OpenTreeMap/otm-core/issues/3170

You may be able to work around it by changing the line to:


geom = GEOSGeometry(open(options['geojson']).read(), srid=4326)

--

treema...@gmail.com

unread,
Jul 18, 2017, 5:37:24 PM7/18/17
to opentreemap-user
you are right, this correction resolve the issue, your example works fine for me, thanks a lot


On Monday, July 17, 2017 at 6:40:49 PM UTC+1, treema...@gmail.com wrote:
Reply all
Reply to author
Forward
0 new messages