config.*
configure
Makefile
+!tests/scenes/bin/Makefile
Makefile.in
stamp-h1
missing
$sSQL .= " from placex where place_id = ".(int)$this->iPlaceID;
$aPlace = $this->oDB->getRow($sSQL);
+ if (PEAR::IsError($aPlace))
+ {
+ failInternalError("Could not lookup place.", $sSQL, $aPlace);
+ }
if (!$aPlace['place_id']) return null;
if ($this->bAddressDetails)
@define('CONST_Search_BatchMode', false);
@define('CONST_Search_TryDroppedAddressTerms', false);
- @define('CONST_Search_NameOnlySearchFrequencyThreshold', false);
+ @define('CONST_Search_NameOnlySearchFrequencyThreshold', 500);
// Set to zero to disable polygon output
@define('CONST_PolygonOutput_MaximumTypes', 1);
CREATE INDEX idx_placex_rank_address ON placex USING BTREE (rank_address) {ts:search-index};
CREATE INDEX idx_placex_pendingsector ON placex USING BTREE (rank_search,geometry_sector) {ts:address-index} where indexed_status > 0;
CREATE INDEX idx_placex_parent_place_id ON placex USING BTREE (parent_place_id) {ts:search-index} where parent_place_id IS NOT NULL;
-CREATE INDEX idx_placex_interpolation ON placex USING BTREE (geometry_sector) {ts:address-index} where indexed_status > 0 and class='place' and type='houses';
CREATE INDEX idx_placex_reverse_geometry ON placex USING gist (geometry) {ts:search-index} where rank_search != 28 and (name is not null or housenumber is not null) and class not in ('waterway','railway','tunnel','bridge');
CREATE INDEX idx_location_area_country_place_id ON location_area_country USING BTREE (place_id) {ts:address-index};
CREATE INDEX idx_location_property_-partition-_centroid ON location_property_-partition- USING GIST (centroid) {ts:address-index};
-- end
+DROP INDEX IF EXISTS place_id_idx;
CREATE UNIQUE INDEX idx_place_osm_unique on place using btree(osm_id,osm_type,class,type) {ts:address-index};
--- /dev/null
+CREATE TABLE word_frequencies AS
+ (SELECT unnest(make_keywords(v)) as id, sum(count) as count
+ FROM (select svals(name) as v, count(*)from place group by v) cnt
+ WHERE v is not null
+ GROUP BY id);
+
+select count(make_keywords(v)) from (select distinct postcode as v from place) as w where v is not null;
+select count(getorcreate_housenumber_id(make_standard_name(v))) from (select distinct housenumber as v from place where housenumber is not null) as w;
+
+-- copy the word frequencies
+update word set search_name_count = count from word_frequencies wf where wf.id = word.word_id;
+
+-- and drop the temporary frequency table again
+drop table word_frequencies;
--- /dev/null
+CXXFLAGS += -O3
+#CXXFLAGS += -g
+CXXFLAGS += -std=c++11 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
+CXXFLAGS += -I../../../../libosmium/include
+
+OS:=$(shell uname -s)
+ifeq ($(OS),Darwin)
+CXXFLAGS += -stdlib=libc++
+LDFLAGS += -stdlib=libc++
+endif
+
+CXXFLAGS_WARNINGS := -Wall -Wextra -pedantic -Wredundant-decls -Wdisabled-optimization -Wctor-dtor-privacy -Wnon-virtual-dtor -Woverloaded-virtual -Wsign-promo -Wold-style-cast
+
+LIB_EXPAT := -lexpat
+LIB_PBF := -pthread -lz -lprotobuf-lite -losmpbf
+LIB_GZIP := -lz
+LIB_BZIP2 := -lbz2
+
+LIB_IO := $(LIB_EXPAT) $(LIB_PBF) $(LIB_GZIP) $(LIB_BZIP2)
+
+all:
+
+osm2wkt: osm2wkt.cc
+ $(CXX) $(CXXFLAGS) $(CXXFLAGS_WARNINGS) -o $@ $< $(LDFLAGS) $(LIB_IO)
+
+scenarios: osm2wkt
datadir="$( cd "$( dirname "$0" )" && cd ../data && pwd )"
-if [! -d "$datadir" ]; then
+if [ ! -d "$datadir" ]; then
echo "Cannot find data dir.";
exit -1;
fi
#include <unordered_map>
#include <osmium/area/assembler.hpp>
-#include <osmium/area/collector.hpp>
+#include <osmium/area/multipolygon_collector.hpp>
#include <osmium/area/problem_reporter_exception.hpp>
#include <osmium/geom/wkt.hpp>
#include <osmium/handler.hpp>
#include <osmium/handler/node_locations_for_ways.hpp>
#include <osmium/io/any_input.hpp>
#include <osmium/visitor.hpp>
-#include <osmium/index/map/stl_map.hpp>
+#include <osmium/index/map/sparse_mem_array.hpp>
-typedef osmium::index::map::StlMap<osmium::unsigned_object_id_type, osmium::Location> index_type;
+typedef osmium::index::map::SparseMemArray<osmium::unsigned_object_id_type, osmium::Location> index_type;
typedef osmium::handler::NodeLocationsForWays<index_type, index_type> location_handler_type;
class ExportToWKTHandler : public osmium::handler::Handler {
- osmium::geom::WKTFactory m_factory;
+ osmium::geom::WKTFactory<> m_factory;
std::unordered_map<std::string, std::ofstream> m_files;
public:
std::string input_filename {argv[1]};
- typedef osmium::area::Assembler area_assembler_type;
osmium::area::ProblemReporterException problem_reporter;
- area_assembler_type assembler(&problem_reporter);
- osmium::area::Collector<area_assembler_type> collector(assembler);
+ osmium::area::Assembler::config_type assembler_config(&problem_reporter);
+ osmium::area::MultipolygonCollector<osmium::area::Assembler> collector(assembler_config);
std::cerr << "Pass 1...\n";
- osmium::io::Reader reader1(input_filename);
+ osmium::io::Reader reader1(input_filename, osmium::osm_entity_bits::relation);
collector.read_relations(reader1);
std::cerr << "Pass 1 done\n";
std::cerr << "Pass 2...\n";
ExportToWKTHandler export_handler;
osmium::io::Reader reader2(input_filename);
- osmium::apply(reader2, location_handler, export_handler, collector.handler());
+ osmium::apply(reader2, location_handler, export_handler, collector.handler([&export_handler](osmium::memory::Buffer&& buffer) {
+ osmium::apply(buffer, export_handler);
+ }));
reader2.close();
- osmium::apply(collector, export_handler);
export_handler.close();
std::cerr << "Pass 2 done\n";