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

Postgis DB to mbtile conversion - coordinate system issue! #25

Open
dhairyashil opened this issue Nov 16, 2017 · 3 comments
Open

Postgis DB to mbtile conversion - coordinate system issue! #25

dhairyashil opened this issue Nov 16, 2017 · 3 comments

Comments

@dhairyashil
Copy link

dhairyashil commented Nov 16, 2017

I am trying to run below command.

tl copy "postgis://username:password@host_id:5432/test?table=schema.lines&geometry_field=geom&srid=3857&layerName=road" "mbtiles://./belgium-tiles.mbtiles" -z 1 -Z 22 -b "2 49 6 52"

But while executing it, I am getting below error:


"C:\Program Files\JetBrains\WebStorm 2017.2.5\bin\runnerw.exe" "C:\Program Files\nodejs\node.exe" C:\Users\bankard\AppData\Roaming\npm\node_modules\tl\bin\tl.js copy postgis://journaldb:journaldb@insrvut-cpp01:5433/raah?table=tileserver_test.lines&geometry_field=geom&srid=3857&layerName=road mbtiles://./belgium-tiles.mbtiles -z 1 -Z 22 -b "2 49 6 52"
C:\Users\bankard\AppData\Roaming\npm\node_modules\tl\node_modules\tilelive-streaming\lib\scanlinescheme.js:45
    if (options.bbox[0] > options.bbox[2]) throw new Error('bbox is invalid');
                                           ^

Error: bbox is invalid
    at new ScanlineScheme (C:\Users\bankard\AppData\Roaming\npm\node_modules\tl\node_modules\tilelive-streaming\lib\scanlinescheme.js:45:50)
    at Function.Scheme.create (C:\Users\bankard\AppData\Roaming\npm\node_modules\tl\node_modules\tilelive-streaming\lib\scheme.js:52:12)
    at C:\Users\bankard\AppData\Roaming\npm\node_modules\tl\node_modules\tilelive-streaming\index.js:161:21
    at Immediate.<anonymous> (C:\Users\bankard\AppData\Roaming\npm\node_modules\tl\node_modules\locking-cache\index.js:73:25)
    at runCallback (timers.js:672:20)
    at tryOnImmediate (timers.js:645:5)
    at processImmediate [as _immediateCallback] (timers.js:617:5)

While debugging I have found that
in file tilelive-streaming/index.js

  var restrict = function(info, by) {
  info = applyConfigDefaults(info);
  by = applyConfigDefaults(by);

  // restrict the options according to known restrictions
  info.minzoom = Math.max(info.minzoom, by.minzoom);
  info.maxzoom = Math.min(info.maxzoom, by.maxzoom);
  info.bounds[0] = Math.max(info.bounds[0], by.bounds[0]);
  info.bounds[1] = Math.max(info.bounds[1], by.bounds[1]);
  info.bounds[2] = Math.min(info.bounds[2], by.bounds[2]);
  info.bounds[3] = Math.min(info.bounds[3], by.bounds[3]);

  return info;
};

this code is actually changing bounding boxes. and replacing it by bounding boxes provided in by object. Can anybody help me to understand from where it is actually computing by 's value and what am I doing wrong in sending parameters?

@mojodna : can you please help me here?

@mojodna
Copy link
Owner

mojodna commented Nov 21, 2017

It's attempting to restrict the resulting bounding box to the minimally-available data. My initial guess is that tilelive-postgis (or whatever is handling the postgis scheme) isn't providing a bounding box.

@dhairyashil
Copy link
Author

yes. shall I raise this in tilelive-postgis module issues?

@mojodna
Copy link
Owner

mojodna commented Nov 22, 2017

That'd be great!

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

No branches or pull requests

2 participants