Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error with url geojson #18

Closed
DemersM opened this issue Sep 16, 2015 · 7 comments
Closed

error with url geojson #18

DemersM opened this issue Sep 16, 2015 · 7 comments

Comments

@DemersM
Copy link

DemersM commented Sep 16, 2015

Maybe I have this problem because my url is on localhost?

I have this geojson at the following url: http:https://localhost:3000/admin/711/lines.geojson

{"type":"FeatureCollection","features":[{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-7576433,6176485],[-7307069,6261483]]},"properties":{"id":38,"codecs":"711","featureId":"025c4e24-6c1e-be63-fe48-27500a55b957","styleId":"Nouvelles limites","createdAt":"2015-09-16T15:09:50.409Z","updatedAt":"2015-09-16T15:09:50.768Z"}}],"crs":{"type":"link","properties":{"href":"http:https://spatialreference.org/ref/sr-org/6864/proj4/","type":"proj4"}}}

Im doing like this:

var tableExport = ogr2ogr('http:https://localhost:3000/admin/711/lines.geojson')
    .format('MapInfo File')
    .stream()
    tableExport.pipe(fs.createWriteStream(mapInfoPath));

I have the following error:

events.js:85
throw er; // Unhandled 'error' event
^
Error: ERROR 1: HTTP error code : 504
FAILURE:
Unable to open datasource `http:https://localhost:3000/admin/711/lines.geojson' with t
he following drivers...

@wavded
Copy link
Owner

wavded commented Sep 16, 2015

@demarsm could be a localhost issue, but what is interesting is you have a 504 bad gateway response, is there a proxy running locally?

@DemersM
Copy link
Author

DemersM commented Sep 16, 2015

Yes I am behind a proxy, but I have to tell you that using the url (https://gist.github.com/wavded/7376428/raw/971548233e441615a426794c766223488492ddb9/test.geojson) found in the geojson-url.js example is working. If ogr2ogr was not able to be used through my proxy, the geojson-url.js would fail the same no?

@DemersM
Copy link
Author

DemersM commented Sep 16, 2015

I am serving the geojson at http:https://localhost:3000/admin/711/lines.geojson like below (its not a static geojson file)

            res.writeHead(200, {'Content-Type': 'application/json'});
            res.end(JSON.stringify(geojson));

can it works even if the geojson is not static?

@wavded
Copy link
Owner

wavded commented Sep 16, 2015

@demarsm that shouldn't make a difference (dynamic vs static), seems like there is an issue in the proxy as the request made received a 504 from the proxy server. Have you tried using curl or some other http client to test?

@DemersM
Copy link
Author

DemersM commented Sep 16, 2015

@wavded You are right, the problem is with the proxy. The url can be accessed by web browsers, but not by other clients. I have tested with another client and I have the same 504 error than with ogr2ogr.

This issue is out of the scope for here. Thank you for your help!

@DemersM DemersM closed this as completed Sep 16, 2015
@DemersM
Copy link
Author

DemersM commented Sep 16, 2015

@wavded The end of the story: the company where I work used to be behind a proxy, but the technicians remove it lately without telling us. The proxy and https-proxy variables that was set on my system, was causing the 504 error. Now that I removed it, everything is working fine.

Thank you again

@wavded
Copy link
Owner

wavded commented Sep 16, 2015

@demarsm glad you got it figured out!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants