Import large geojson

Hi,

I am trying to import large geojson file (1.4GB) but getting a connection timeout error from the host. Is there a way to put local file path instead of http URL? Or is there a way to manually import the geojson file. Any help would be really appreciated.

Below is the error.

05-07 22:28:40 ERROR middleware.log :: PUT /api/setting/custom-geojson 500 1.0 mins (0 DB calls)
{:message “Connection to host timed out for URL https://github.com/jgoodall/us-maps/raw/master/geojson/zcta5.geo.json“,
:type java.lang.Exception,
:stacktrace
[”–> api.geojson$valid_json_url_string_QMARK_.invokeStatic(geojson.clj:63)”
“api.geojson$valid_json_url_string_QMARK_.invoke(geojson.clj:53)”
“api.geojson$fn__56258.invokeStatic(geojson.clj:80)”
“api.geojson$fn__56258.invoke(geojson.clj:79)”
“api.geojson$validate_custom_geo_json.invokeStatic(geojson.clj:106)”
“api.geojson$validate_custom_geo_json.invoke(geojson.clj:103)”
“api.geojson$fn__56277$fn__56278.invoke(geojson.clj:115)”
“models.setting$set_BANG_.invokeStatic(setting.clj:393)”
“models.setting$set_BANG_.invoke(setting.clj:378)”
“api.setting$fn__65013.invokeStatic(setting.clj:34)”
“api.setting$fn__65013.invoke(setting.clj:28)”
“middleware.auth$enforce_authentication$fn__66808.invoke(auth.clj:14)”
“routes$fn__68332$fn__68333.doInvoke(routes.clj:56)”
“middleware.exceptions$catch_uncaught_exceptions$fn__66907.invoke(exceptions.clj:97)”
“middleware.exceptions$catch_api_exceptions$fn__66904.invoke(exceptions.clj:85)”
“middleware.log$log_api_call$fn__68710$fn__68711.invoke(log.clj:197)”
“middleware.log$log_api_call$fn__68710.invoke(log.clj:191)”
“middleware.security$add_security_headers$fn__66870.invoke(security.clj:121)”
“middleware.json$wrap_json_body$fn__68413.invoke(json.clj:64)”
“middleware.json$wrap_streamed_json_response$fn__68431.invoke(json.clj:100)”
“middleware.misc$maybe_set_site_url$fn__68740.invoke(misc.clj:59)”
“middleware.session$bind_current_user$fn__63397$fn__63398.invoke(session.clj:209)”
“middleware.session$do_with_current_user.invokeStatic(session.clj:184)”
“middleware.session$do_with_current_user.invoke(session.clj:177)”
“middleware.session$bind_current_user$fn__63397.invoke(session.clj:208)”
“middleware.session$wrap_current_user_id$fn__63382.invoke(session.clj:161)”
“middleware.session$wrap_session_id$fn__63326.invoke(session.clj:125)”
“middleware.auth$wrap_api_key$fn__66816.invoke(auth.clj:27)”
“middleware.misc$bind_user_locale$fn__68745.invoke(misc.clj:78)”
“middleware.misc$add_content_type$fn__68726.invoke(misc.clj:29)”
“middleware.misc$disable_streaming_buffering$fn__68754.invoke(misc.clj:94)”
“server$async_proxy_handler$fn__68488.invoke(server.clj:70)”
“server.proxy$org.eclipse.jetty.server.handler.AbstractHandler$ff19274a.handle(Unknown Source)”]}

Thanks,
Zee

Hi @zeehasham
There’s no “import” function. Metabase just proxies the map for the end-user, so that means the user’s browser would have to load 1.4GB of data to see the map.
As far as I know, no browser is able to do that.
Use mapshaper.org or similar tools to slim down the GeoJSON - I would recommend something below 10MB (which is already a large download for most browsers).