Giter Site home page Giter Site logo

bagconv's People

Contributors

berthubert avatar lesander avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

bagconv's Issues

Adding zipcode to coordinate method

The method that returns an object given a latitude and longitude (bag.nl/x/y) is really useful, but would hugely benefit from also returning a zip or postcode per object. Perhaps there's some other way to get pcodes from coordinates?

No coordinates for non-vbo vbo_types

There are no coordinates (i.e. -1.0,-1.0) for e.g.:

straat huisnummer huisletter huistoevoeging woonplaats postcode x y lon lat oppervlakte gebruiksdoelen num_status vbo_status vbo_type num_id vbo_id opr_id
Piekenwaardweg 10 a 202 Kerkdriel 5331PD -1.0 -1.0 3.31357161339861 47.9747577455202 -1 [] Naamgeving uitgegeven Plaats aangewezen sta 0263200000366237 0263030000012451 0263300000000417

This seems to be the case for all non-vbo vbo_types, as can be confirmed by the following SQL query returning 0 results:

SELECT * FROM unilabel WHERE vbo_type <> 'vbo' AND x <> -1.0;

Missing location of ships ("ligplaatsen") and maybe other objects as well

pcodes-geo.zip contains lots of invalid locations (x=-1, y=-1) and it appears that these are (mostly?) ships.
bagserv gives no output at all for such addresses. E.g. 2231BG 293.
(btw the official BAG viewer map also seems to struggle a bit: The location (blue dot) only appears on the map after a search but not after clicking on the object)

date filter is not correct

We now always believe the "newest" version. However, for example for num ID 0302200000188380 the BAG contains news that a house number will change per 1st of July (which it isn't yet). But we believe it already.

RD based coordinate search in bagserv

I think it would be neat if bagserv would also provide a way to search using RD-coordinates.

I've tried implementing it using this code, but I think something is wrong with the SQL query; which I can imagine since I just copied the WGS84 search and changed lat to x and lon to y. What would be the proper way to implement this?

diff --git a/bagserv.cc b/bagserv.cc
index e268c14..8f8dcf4 100644
--- a/bagserv.cc
+++ b/bagserv.cc
@@ -139,7 +139,25 @@ int main(int argc, char**argv)
     }
   });
 
-  
+  // Search based on RD coordinates in the form of /rd/{x}/{y}
+  svr.Get(R"(/rd/(\d*\.\d*)/(\d*\.\d*))", [&sqw, &sqwlock](const httplib::Request &req, httplib::Response &res) {
+    try {
+      auto xstr = (string)req.matches[1];
+      auto ystr = (string)req.matches[2];
+      double x = atof(xstr.c_str());
+      double y = atof(ystr.c_str());
+      cout<<"Query for "<< x <<", "<< y <<endl;
+      vector<unordered_map<string,string>> result;
+      {
+        std::lock_guard<mutex> l(sqwlock);
+        result=sqw.query("select x as rdX, y as rdY,straat,woonplaats,huisnummer,huisletter,huistoevoeging,oppervlakte,bouwjaar,lon,lat,gebruiksdoel,num_status,vbo_status, (x-?)*(x-?)+(y-?)*(y-?) as deg2dist from geoindex,alllabel where alllabel.vbo_id = geoindex.vbo_id and minX > ? and maxX < ? and minY > ? and maxY < ? order by deg2dist asc limit 1", {x, x, y, y, x-0.005, x+0.005, y-0.005, y+0.005});
+      }
+      res.set_content(packResults(result), "application/json");
+    }
+    catch(exception& e) {
+      cerr<<"Error: "<<e.what()<<endl;
+    }
+  });
   
   svr.listen("0.0.0.0", argc==1 ? 8080 : atoi(argv[1]));
 }

Make it easier to find historical addresses

Sometimes e.g. house numbers are changed. It would be great if it would be easier to find historical addresses (by searching with e.g. the old house number) and also e.g. be able to find the current address for it.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.