Skip to content
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

import address not work #36

Closed
stefanocudini opened this issue May 16, 2019 · 4 comments · Fixed by #37
Closed

import address not work #36

stefanocudini opened this issue May 16, 2019 · 4 comments · Fixed by #37

Comments

@stefanocudini
Copy link

hi I need to import a custom list of addresses from CSV files, I have coded the columns as indicated in the documentation
but after I execute import in ealstich search nothing is shown

this is a sample of my csv file

lon,lat,number,zipcode,street,layer,source
11.1258038738599,46.0384255604388,4,38123,,address,csv
11.1352742761045,46.0539734971077,101,38122,,address,csv
11.1251450165258,46.0535672621879,46,38123,Via Antonio Gramsci,address,csv
11.1363143019353,46.0627887491022,10,38122,,address,csv
11.126024700547,46.0564461996177,22,38122,,address,csv
11.1192645125392,46.0599223809797,1,38122,Via fratelli Perini,address,csv
11.1359105131297,46.0617807770361,9,38122,,address,csv
11.1467344763048,46.0752138268721,21,38121,,address,csv
11.1399449465559,46.0777789405135,13,38121,Via delle Marnighe,address,csv

this is my pelias.json file

{
  "logger": {
    "level": "debug",
    "timestamp": false,
    "colorize": true
  },
  "esclient": {
    "apiVersion": "5.6",
    "hosts": [
      {
        "host": "elasticsearch"
      }
    ]
  },
  "elasticsearch": {
    "settings": {
      "index": {
        "refresh_interval": "10s",
        "number_of_replicas": "0",
        "number_of_shards": "1"
      }
    }
  },
  "acceptance-tests": {
    "endpoints": {
      "docker": "http://api:4000/v1/"
    }
  },
  "api": {
    "textAnalyzer": "libpostal",
    "services": {
      "placeholder": {
        "url": "http://placeholder:4100"
      },
      "pip": {
        "url": "http://pip:4200"
      },
      "interpolation": {
        "url": "http://interpolation:4300"
      },
      "libpostal": {
        "url": "http://libpostal:4400"
      }
    },
    "defaultParameters": {
      "focus.point.lat": 45.52,
      "focus.point.lon": -122.67
    }
  },
  "imports": {
    "adminLookup": {
      "enabled": false
    },
    "openstreetmap": {
      "leveldbpath": "/tmp",
      "datapath": "/data/openstreetmap",
      "import": [
        {
          "filename": "trentino-alto-adige.osm.pbf"
        }
      ]
    },
    "csv": {
      "datapath": "/data/csv",
      "files": [
        "trento_civici_strade.csv"
      ]
    },
    "whosonfirst": {
      "datapath": "/data/whosonfirst",
      "importVenues": false,
      "importPostalcodes": true,
      "importPlace": [
        "85685277"
      ]
    }
  }
}
orangejulius added a commit that referenced this issue May 16, 2019
This ties into the new documentation for the API in
pelias/api#1297 for functionality originally
added in pelias/api#1131.

Fixes #36
Fixes #26
@orangejulius
Copy link
Member

Hey @stefanocudini,
Sorry about that, and thanks for reporting this. There's an extra configuration step required for custom data that wasn't well documented. I just opened pelias/api#1297 and #37 to fix it. Can you take a look at those PRs and tell me if the explanations are clear?

Thanks!

@stefanocudini
Copy link
Author

stefanocudini commented May 17, 2019

tnks @orangejulius how can I apply new config without reimport all data?
can i run only command pelias compose up??

isn't clean where should i put this config:

"layers_by_source": {
  "openstreetmap": [ "address", "venue", "street" ],
  "openaddresses": [ "address" ],
  "geonames": [
    "country", "macroregion", "region", "county", "localadmin", "locality", "borough", 
    "neighbourhood", "venue"
  ],
  "whosonfirst": [
    "continent", "empire", "country", "dependency", "macroregion", "region", "locality",
    "localadmin", "macrocounty", "county", "macrohood", "borough", "neighbourhood", 
    "microhood", "disputed", "venue", "postalcode", "continent", "ocean", "marinearea"
  ]
}

@orangejulius
Copy link
Member

Unfortunately docker-compose isn't smart enough to pick up changes to pelias.json, but

pelias compose kill api
pelias compose up api

You shouldn't have to put anything in layers_by_source for the default data sources, those are already in the config and any additions will purely extend, not overwrite.

@stefanocudini
Copy link
Author

stefanocudini commented May 20, 2019

yes but where I can put "layers_by_source"?? inside pelias.json?

i trying this configuration, but when i try ti request to APi it response empty result :( why?
http://localhost:4000/v1/autocomplete?text=Via Antonio
this address exists in my csv file in column address

"api": {
   ...
    "targets": {
      "layers_by_source": {
        "csv": ["address"]
      }
    }
  },
"imports": {
    ...
    "csv": {
      "datapath": "/data/csv",
      "files": [
        "trento_civici_strade.csv"
      ]
    },
}

this is my csv file(trento_civici_strade.csv)
lon,lat,number,zipcode,street,layer,source
11.1258038738599,46.0384255604388,4,38123,,address,csv
11.1352742761045,46.0539734971077,101,38122,,address,csv
11.1251450165258,46.0535672621879,46,38123,Via Antonio Gramsci,address,csv

I'm using the csv importer because my openaddress data source is not available online

from the steps taken it is not clear to me why the data are not imported into pelias
Is there a way to query pelias-api and make me return a statistic of all the data loaded for each data source? to be able to debug

is is my csv file(trento_civici_strade.csv)
lon,lat,number,zipcode,street,layer,source
11.1258038738599,46.0384255604388,4,38123,,address,openaddress

I also tried using a column with a standard source openaddress but this data is not loaded

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

Successfully merging a pull request may close this issue.

2 participants