kekscom / osmbuildings

OSM Buildings Classic 2.5D
http://osmbuildings.org
BSD 2-Clause "Simplified" License
504 stars 140 forks source link

convert.js: bbox #20

Closed putnik closed 11 years ago

putnik commented 11 years ago

I tried to use bboxes and found two errors.

  1. Unnecessary WHERE in line 82:
    return 'WHERE ST_Intersects(ST_GeomFromText(\'' + polygon + '\', 4326), ' + pgFootprintField + ')';
  1. It's my fault, but I don't know how to fix it in node.js. pgBBox must be object, but it's a string, when we get it from arguments.
kekscom commented 11 years ago

I should have tested this as well :-) I'd say, alow --pg-bbox to be something like '52.52,13.37,52.50,13.35'. Then in the function you can:

  1. just split(',') it
  2. depending on lat/lon order just define index accessors, pseudo code: if(lat/lon) n = 0, w = 1 else n = 1, w = 0 ..

Should fix it.

kekscom commented 11 years ago

Any news? :-)

putnik commented 11 years ago

GItHub merged both commits into one pull request, and I can do nothing with it. I hope you can.

kekscom commented 11 years ago

I'm trying to check this tomorrow. Thanks!

kekscom commented 11 years ago

Closing this now as all server logic got removed from the core project. But don't worry, topic will continue in a separate repo for any kind of custom data services. Place will be about here: https://github.com/OSMBuildings/server