Hi Adam,
It's me again regarding the same subject.
I've already successfully loaded the sql files to the database (arches) and
executed the python commad for the json files but I get the following error
message:
operation: add_tileserver_layer
package: arches
Traceback (most recent call last):
File "manage.py", line 27, in <module>
execute_from_command_line(sys.argv)
File
"/home/ubuntu/Projects/ENV/local/lib/python2.7/site-packages/django/core/
management/__init__.py", line 364, in
execute_from_command_line
utility.execute()
File
"/home/ubuntu/Projects/ENV/local/lib/python2.7/site-packages/django/core/
management/__init__.py", line 356, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File
"/home/ubuntu/Projects/ENV/local/lib/python2.7/site-packages/django/core/
management/base.py", line 283, in run_from_argv
self.execute(*args, **cmd_options)
File
"/home/ubuntu/Projects/ENV/local/lib/python2.7/site-packages/django/core/
management/base.py", line 330, in execute
output = self.handle(*args, **options)
File
"/home/ubuntu/Projects/arches/arches/management/commands/packages.py", li
ne 188, in handle
self.add_tileserver_layer(options['layer_name'],
options['mapnik_xml_path'], options['layer_icon'],
options['is_basemap'], options['tile_config_path'])
File
"/home/ubuntu/Projects/arches/arches/management/commands/packages.py", li
ne 907, in add_tileserver_layer
config_data = json.load(content)
File "/usr/lib/python2.7/json/__init__.py", line 291, in load
**kw)
File "/usr/lib/python2.7/json/__init__.py", line 339, in loads
return _default_decoder.decode(s)
File "/usr/lib/python2.7/json/decoder.py", line 364, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib/python2.7/json/decoder.py", line 380, in raw_decode
obj, end = self.scan_once(s, idx)
ValueError: Expecting , delimiter: line 51 column 2 (char 3923)
Since I am almost sure it has something to do with the sintax of the json
file (I am not a programmer), I join the file (with no password) in the
hope that you can help me:
{
"type": "FeatureCollection",
"features": [
{ "type": "Feature", "properties": { "KML_STYLE": "msn_I3", "KML_FOLDER":
"Arcos de Valdevez" }, "geometry": { "type": "Point", "coordinates": [
-8.450217, 41.938804 ] } }
,
{ "type": "Feature", "properties": { "KML_STYLE": "msn_M", "KML_FOLDER":
"Arcos de Valdevez" }, "geometry": { "type": "Point", "coordinates": [
-8.343963, 41.870299 ] } }
,
{ "type": "Feature", "properties": { "KML_STYLE": "msn_M", "KML_FOLDER":
"Arcos de Valdevez" }, "geometry": { "type": "Point", "coordinates": [
-8.389271, 41.868684 ] } }
,
{ "type": "Feature", "properties": { "KML_STYLE": "msn_I1", "KML_FOLDER":
"Caminha" }, "geometry": { "type": "Point", "coordinates": [ -8.832159,
41.873065 ] } }
,
{ "type": "Feature", "properties": { "KML_STYLE": "msn_M0", "KML_FOLDER":
"Caminha" }, "geometry": { "type": "Point", "coordinates": [ -8.838441,
41.801253 ] } }
,
{ "type": "Feature", "properties": { "KML_STYLE": "msn_M0", "KML_FOLDER":
"Caminha" }, "geometry": { "type": "Point", "coordinates": [ -8.841388,
41.809651 ] } }
,
{ "type": "Feature", "properties": { "KML_STYLE": "msn_M0", "KML_FOLDER":
"Caminha" }, "geometry": { "type": "Point", "coordinates": [ -8.787310,
41.906306 ] } }
,
{ "type": "Feature", "properties": { "KML_STYLE": "msn_M0", "KML_FOLDER":
"Caminha" }, "geometry": { "type": "Point", "coordinates": [ -8.850757,
41.809936 ] } }
,
{ "type": "Feature", "properties": { "KML_STYLE": "msn_V1", "KML_FOLDER":
"Melgaço" }, "geometry": { "type": "Point", "coordinates": [ -8.098310,
42.070975 ] } }
,
{ "type": "Feature", "properties": { "KML_STYLE": "msn_M1", "KML_FOLDER":
"Melgaço" }, "geometry": { "type": "Point", "coordinates": [ -8.279876,
42.092524 ] } }
,
{ "type": "Feature", "properties": { "KML_STYLE": "msn_M1", "KML_FOLDER":
"Monção" }, "geometry": { "type": "Point", "coordinates": [ -8.452002,
42.027202 ] } }
,
{ "type": "Feature", "properties": { "KML_STYLE": "msn_V0", "KML_FOLDER":
"Ponte da Barca" }, "geometry": { "type": "Point", "coordinates": [
-8.251466, 41.840543 ] } }
,
{ "type": "Feature", "properties": { "KML_STYLE": "msn_I2", "KML_FOLDER":
"Paredes de Coura" }, "geometry": { "type": "Point", "coordinates": [
-8.627916, 41.873977 ] } }
,
{ "type": "Feature", "properties": { "KML_STYLE": "msn_C", "KML_FOLDER":
"Ponte de Lima" }, "geometry": { "type": "Point", "coordinates": [
-8.560746, 41.795792 ] } }
,
{ "type": "Feature", "properties": { "KML_STYLE": "msn_I", "KML_FOLDER":
"Ponte de Lima" }, "geometry": { "type": "Point", "coordinates": [
-8.605898, 41.780252 ] } }
,
{ "type": "Feature", "properties": { "KML_STYLE": "msn_I", "KML_FOLDER":
"Ponte de Lima" }, "geometry": { "type": "Point", "coordinates": [
-8.611713, 41.715959 ] } }
,
{ "type": "Feature", "properties": { "KML_STYLE": "msn_I", "KML_FOLDER":
"Ponte de Lima" }, "geometry": { "type": "Point", "coordinates": [
-8.612457, 41.694275 ] } }
,
{ "type": "Feature", "properties": { "KML_STYLE": "msn_I", "KML_FOLDER":
"Ponte de Lima" }, "geometry": { "type": "Point", "coordinates": [
-8.607588, 41.694813 ] } }
,
{ "type": "Feature", "properties": { "KML_STYLE": "msn_I", "KML_FOLDER":
"Ponte de Lima" }, "geometry": { "type": "Point", "coordinates": [
-8.643646, 41.792144 ] } }
,
{ "type": "Feature", "properties": { "KML_STYLE": "msn_V", "KML_FOLDER":
"Valença" }, "geometry": { "type": "Point", "coordinates": [ -8.639526,
42.002488 ] } }
,
{ "type": "Feature", "properties": { "KML_STYLE": "msn_I0", "KML_FOLDER":
"Valença" }, "geometry": { "type": "Point", "coordinates": [ -8.588610,
41.997460 ] } }
,
{ "type": "Feature", "properties": { "KML_STYLE": "msn_E", "KML_FOLDER":
"Vila Nova de Cerveira" }, "geometry": { "type": "Point", "coordinates": [
-8.739175, 41.952262 ] } }
,
{ "type": "Feature", "properties": { "KML_STYLE": "msn_I2", "KML_FOLDER":
"Vila Nova de Cerveira" }, "geometry": { "type": "Point", "coordinates": [
-8.697189, 41.888439 ] } }
"config": {
"provider": {
"class": "TileStache.Goodies.VecTiles:Provider",
"kwargs": {
"dbinfo": {
"host": "localhost",
"user": "postgres",
"password": "XXXXXXX",
"database": "arches",
"port": "5432"
},
"simplify": 0.5,
"queries": [
"select gid as __id__, name, st_asgeojson(geom) as geojson,
st_transform(geom, 900913) as __geometry__ from arqueologia"
]
}
},
"allowed origin": "*",
"compress": true,
"write cache": false
}
]
}
Once again thanks,
sexta-feira, 19 de Janeiro de 2018 às 15:18:47 UTC, Adam Cox escreveu:
>
> Based on the example here
> http://arches4.readthedocs.io/en/stable/managing-map-layers/#tileserver-layers,
>
> you can see that the db info is in the "config" section of the .json file
> (if you are making a layer based on a postgis table). It occurs to me now
> that you should be wary of sharing config files such as this, as they would
> likely contain the credentials to your Arches pg database (unless you are
> pulling from another database... either way, you shouldn't share those
> credentials...).
>
> Adam
>
> On Fri, Jan 19, 2018 at 9:13 AM, David Lopes <[email protected]
> <javascript:>> wrote:
>
>> Adam,
>>
>> One more question: the .json file requires a few lines connecting with
>> the database, right?
>>
>> Best regards.
>>
>>
>>
>> quinta-feira, 18 de Janeiro de 2018 às 18:04:17 UTC, Adam Cox escreveu:
>>>
>>> FYI I just tested loading the sql from that repo example and then
>>> loading the tile layer with the config file that's in there, and the layer
>>> loaded correctly.
>>>
>>> On Thu, Jan 18, 2018 at 9:59 AM, Adam Cox <[email protected]> wrote:
>>>
>>>> Hi David, are you using a config file from the repo, or have you made a
>>>> new one? From looking at the error, it seems like the config file you are
>>>> using may have [ ] in the outermost position instead of { }, but the
>>>> config
>>>> files in that repo do look fine to me.
>>>>
>>>> Adam
>>>>
>>>> On Thu, Jan 18, 2018 at 9:13 AM, David Lopes <[email protected]> wrote:
>>>>
>>>>> Hi,
>>>>>
>>>>> I've been trying to add .sql and .json files to the data base without
>>>>> success (https://github.com/legiongis/arches4-geo-examples)
>>>>>
>>>>> I get the following message:
>>>>>
>>>>> operation: add_tileserver_layer
>>>>> package: arches
>>>>> Traceback (most recent call last):
>>>>> File "manage.py", line 27, in <module>
>>>>> execute_from_command_line(sys.argv)
>>>>> File
>>>>> "/home/ubuntu/Projects/ENV/local/lib/python2.7/site-packages/django/core/management/__init__.py",
>>>>>
>>>>> line 364, in execute_from_command_line
>>>>> utility.execute()
>>>>> File
>>>>> "/home/ubuntu/Projects/ENV/local/lib/python2.7/site-packages/django/core/management/__init__.py",
>>>>>
>>>>> line 356, in execute
>>>>> self.fetch_command(subcommand).run_from_argv(self.argv)
>>>>> File
>>>>> "/home/ubuntu/Projects/ENV/local/lib/python2.7/site-packages/django/core/management/base.py",
>>>>>
>>>>> line 283, in run_from_argv
>>>>> self.execute(*args, **cmd_options)
>>>>> File
>>>>> "/home/ubuntu/Projects/ENV/local/lib/python2.7/site-packages/django/core/management/base.py",
>>>>>
>>>>> line 330, in execute
>>>>> output = self.handle(*args, **options)
>>>>> File
>>>>> "/home/ubuntu/Projects/arches/arches/management/commands/packages.py",
>>>>> line
>>>>> 188, in handle
>>>>> self.add_tileserver_layer(options['layer_name'],
>>>>> options['mapnik_xml_path'], options['layer_icon'], options['is_basemap'],
>>>>> options['tile_config_path'])
>>>>> File
>>>>> "/home/ubuntu/Projects/arches/arches/management/commands/packages.py",
>>>>> line
>>>>> 908, in add_tileserver_layer
>>>>> config = config_data["config"]
>>>>> TypeError: list indices must be integers, not str
>>>>>
>>>>>
>>>>> Can you tell what's wrong?
>>>>>
>>>>> Thanks
>>>>>
>>>>> --
>>>>> -- To post, send email to [email protected]. To unsubscribe,
>>>>> send email to [email protected]. For more information,
>>>>> visit https://groups.google.com/d/forum/archesproject?hl=en
>>>>> ---
>>>>> You received this message because you are subscribed to the Google
>>>>> Groups "Arches Project" group.
>>>>> To unsubscribe from this group and stop receiving emails from it, send
>>>>> an email to [email protected].
>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>>
>>>>
>>>>
>>> --
>> -- To post, send email to [email protected] <javascript:>. To
>> unsubscribe, send email to [email protected] <javascript:>.
>> For more information, visit
>> https://groups.google.com/d/forum/archesproject?hl=en
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "Arches Project" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected] <javascript:>.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
--
-- To post, send email to [email protected]. To unsubscribe, send
email to [email protected]. For more information,
visit https://groups.google.com/d/forum/archesproject?hl=en
---
You received this message because you are subscribed to the Google Groups
"Arches Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.