summaryrefslogtreecommitdiff
path: root/geography/osm2pgsql
diff options
context:
space:
mode:
authorwiedi <wiedi>2015-06-10 01:48:49 +0000
committerwiedi <wiedi>2015-06-10 01:48:49 +0000
commit5f4bb7cfaec0a314fd0be9492ec098a362dcf66e (patch)
treed61b52265e9a87ace78701af413c4561e879fe5f /geography/osm2pgsql
parent62df96267149c86e10cc3127b22774b4801cece4 (diff)
downloadpkgsrc-5f4bb7cfaec0a314fd0be9492ec098a362dcf66e.tar.gz
Import osm2pgsql-0.87.3 as geography/osm2pgsql
Converts OSM planet.osm data to a PostgreSQL / PostGIS database suitable for specific applications like rendering into map tiles by Mapnik or geocoding with Nominatim.
Diffstat (limited to 'geography/osm2pgsql')
-rw-r--r--geography/osm2pgsql/DESCR3
-rw-r--r--geography/osm2pgsql/Makefile38
-rw-r--r--geography/osm2pgsql/PLIST7
-rw-r--r--geography/osm2pgsql/distinfo7
-rw-r--r--geography/osm2pgsql/patches/patch-middle-pgsql.cpp17
-rw-r--r--geography/osm2pgsql/patches/patch-node-persistent-cache.cpp35
6 files changed, 107 insertions, 0 deletions
diff --git a/geography/osm2pgsql/DESCR b/geography/osm2pgsql/DESCR
new file mode 100644
index 00000000000..396de411f59
--- /dev/null
+++ b/geography/osm2pgsql/DESCR
@@ -0,0 +1,3 @@
+Converts OSM planet.osm data to a PostgreSQL / PostGIS database suitable
+for specific applications like rendering into map tiles by Mapnik
+or geocoding with Nominatim.
diff --git a/geography/osm2pgsql/Makefile b/geography/osm2pgsql/Makefile
new file mode 100644
index 00000000000..f367bf6f178
--- /dev/null
+++ b/geography/osm2pgsql/Makefile
@@ -0,0 +1,38 @@
+# $NetBSD: Makefile,v 1.1 2015/06/10 01:48:49 wiedi Exp $
+
+DISTNAME= osm2pgsql-0.87.3
+CATEGORIES= geography
+MASTER_SITES= ${MASTER_SITE_GITHUB:=openstreetmap/}
+GITHUB_TAG= ${PKGVERSION_NOREV}
+
+MAINTAINER= wiedi@frubar.net
+HOMEPAGE= https://github.com/openstreetmap/osm2pgsql/
+COMMENT= OpenStreetMap data to PostgreSQL converter
+LICENSE= gnu-gpl-v2
+
+USE_LANGUAGES= c c++
+USE_LIBTOOL= yes
+USE_TOOLS+= gmake autoconf aclocal automake
+GNU_CONFIGURE= yes
+
+CONFIGURE_ARGS+= --with-zlib=${BUILDLINK_PREFIX.zlib}
+CONFIGURE_ARGS+= --with-bzip2=${BUILDLINK_PREFIX.bzip2}
+CONFIGURE_ARGS+= --with-proj=${BUILDLINK_PREFIX.proj}
+CONFIGURE_ARGS+= --with-protobuf-c=${BUILDLINK_PREFIX.protobuf-c}
+CONFIGURE_ARGS+= --with-boost=${BUILDLINK_PREFIX.boost-libs}
+
+.include "../../mk/bsd.prefs.mk"
+
+pre-configure:
+ cd ${WRKSRC} && aclocal && ./autogen.sh
+
+.include "../../textproc/libxml2/buildlink3.mk"
+.include "../../geography/geos/buildlink3.mk"
+.include "../../geography/proj/buildlink3.mk"
+.include "../../archivers/bzip2/buildlink3.mk"
+.include "../../devel/boost-libs/buildlink3.mk"
+.include "../../devel/protobuf-c/buildlink3.mk"
+.include "../../devel/zlib/buildlink3.mk"
+.include "../../databases/postgresql-postgis2/buildlink3.mk"
+.include "../../lang/lua/buildlink3.mk"
+.include "../../mk/bsd.pkg.mk"
diff --git a/geography/osm2pgsql/PLIST b/geography/osm2pgsql/PLIST
new file mode 100644
index 00000000000..70332c4189c
--- /dev/null
+++ b/geography/osm2pgsql/PLIST
@@ -0,0 +1,7 @@
+@comment $NetBSD: PLIST,v 1.1 2015/06/10 01:48:49 wiedi Exp $
+bin/nodecachefilereader
+bin/osm2pgsql
+man/man1/nodecachefilereader.1
+man/man1/osm2pgsql.1
+share/osm2pgsql/900913.sql
+share/osm2pgsql/default.style
diff --git a/geography/osm2pgsql/distinfo b/geography/osm2pgsql/distinfo
new file mode 100644
index 00000000000..5b3e2868fbb
--- /dev/null
+++ b/geography/osm2pgsql/distinfo
@@ -0,0 +1,7 @@
+$NetBSD: distinfo,v 1.1 2015/06/10 01:48:49 wiedi Exp $
+
+SHA1 (osm2pgsql-0.87.3.tar.gz) = 977f1c6591a7603240dafd31ca67a18f01537ab8
+RMD160 (osm2pgsql-0.87.3.tar.gz) = bacfb31b95611cd9c02e005bbc50749f1ac1905b
+Size (osm2pgsql-0.87.3.tar.gz) = 2141464 bytes
+SHA1 (patch-middle-pgsql.cpp) = 71146a00bdfd486ae0b7ed74566270b4671175b7
+SHA1 (patch-node-persistent-cache.cpp) = db641099525c275af06f86377d30b7f67d1e273a
diff --git a/geography/osm2pgsql/patches/patch-middle-pgsql.cpp b/geography/osm2pgsql/patches/patch-middle-pgsql.cpp
new file mode 100644
index 00000000000..3234719d683
--- /dev/null
+++ b/geography/osm2pgsql/patches/patch-middle-pgsql.cpp
@@ -0,0 +1,17 @@
+$NetBSD: patch-middle-pgsql.cpp,v 1.1 2015/06/10 01:48:49 wiedi Exp $
+
+Need alloca.h on SunOS
+
+--- middle-pgsql.cpp.orig 2015-04-30 04:15:07.000000000 +0000
++++ middle-pgsql.cpp
+@@ -33,6 +33,10 @@ using namespace std;
+ #define alloca _alloca
+ #endif
+
++#if defined(__sun)
++#include <alloca.h>
++#endif
++
+ #include <libpq-fe.h>
+
+ #include "osmtypes.hpp"
diff --git a/geography/osm2pgsql/patches/patch-node-persistent-cache.cpp b/geography/osm2pgsql/patches/patch-node-persistent-cache.cpp
new file mode 100644
index 00000000000..488c734ba3a
--- /dev/null
+++ b/geography/osm2pgsql/patches/patch-node-persistent-cache.cpp
@@ -0,0 +1,35 @@
+$NetBSD: patch-node-persistent-cache.cpp,v 1.1 2015/06/10 01:48:49 wiedi Exp $
+
+Use std namespace to find isnan
+
+--- node-persistent-cache.cpp.orig 2015-04-30 04:15:07.000000000 +0000
++++ node-persistent-cache.cpp
+@@ -450,7 +450,7 @@ int node_persistent_cache::set_append(os
+ block_id = load_block(block_offset);
+
+ #ifdef FIXED_POINT
+- if (isnan(lat) && isnan(lon))
++ if (std::isnan(lat) && std::isnan(lon))
+ {
+ readNodeBlockCache[block_id].nodes[id & READ_NODE_BLOCK_MASK].lat =
+ INT_MIN;
+@@ -512,8 +512,8 @@ int node_persistent_cache::get(struct os
+ return 0;
+ }
+ #else
+- if ((isnan(readNodeBlockCache[block_id].nodes[id & READ_NODE_BLOCK_MASK].lat)) &&
+- (isnan(readNodeBlockCache[block_id].nodes[id & READ_NODE_BLOCK_MASK].lon)))
++ if ((std::isnan(readNodeBlockCache[block_id].nodes[id & READ_NODE_BLOCK_MASK].lat)) &&
++ (std::isnan(readNodeBlockCache[block_id].nodes[id & READ_NODE_BLOCK_MASK].lon)))
+ {
+ return 1;
+ }
+@@ -547,7 +547,7 @@ int node_persistent_cache::get_list(node
+
+ size_t wrtidx = 0;
+ for (size_t i = 0; i < nds.size(); i++) {
+- if (isnan(out[i].lat) && isnan(out[i].lon)) {
++ if (std::isnan(out[i].lat) && std::isnan(out[i].lon)) {
+ if (get(&(out[wrtidx]), nds[i]) == 0)
+ wrtidx++;
+ } else {