Closed epilurzu closed 2 years ago
by default it tries to load the file over http, and it apparently interprets "shapefile"
as "http://localhost:80/shapefile"
so you should either spin up a server to host it (and then point to the correct port as you probably don't want to run it as root, so something like shp("http://localhost:5000/shapefile")
if you were to run a local sever with npx serve
or you could zip it and load the zipfile from the filesystem with the node fs module and just pass in the buffer.
I ran a local server using npx server
as you suggested, but there are still some issues.
Me too, as in issue #108, I am trying to convert large files (about 1.1 GB the shapefile, 762 MB once zipped).
The terminal printed some information, with this error:
FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
I found on the internet a way to increase the heap limit up to 8 GB by executing command node --max-old-space-size=8192 .\test.js
, but after 20 minutes of computation the terminal still gave me the same output in the end.
Is there a size limit for the shapefile? Is there any difference in giving to the algorithm the zip file or the shapefile?
Hi,
I downloaded the entire project and opened the index.html file. No data is showing up on the screen but Leaflet is displayed with the minimize and maximize tools showing.
Is there something else I should install?
I apologize in advance; I'm a novice when it comes to js, so I could be making trivial mistakes.
I have done this steps:
npm install shpjs --save
command from the terminal;node test.js
command from the terminal.This is the output:
Handle rejected promise (Error: connect ECONNREFUSED 127.0.0.1:80) here.
I tried to look for the meaning of this error message, but I didn't understand how to handle it.