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

Issue 194 #196

Merged
merged 6 commits into from
Jul 3, 2014
Merged

Issue 194 #196

merged 6 commits into from
Jul 3, 2014

Conversation

bpross-52n
Copy link
Member

Fix for #194. Measurement limit for shapefile export: 500 (configurable) Everything above that will result in a HTTP 500 error:
2014-06-24-tracktoolongexception

@bpross-52n bpross-52n mentioned this pull request Jun 24, 2014
private final String shapefileExportThresholdPropertyName = "shapefile.export.measurement.threshold";
private Track track;
private Properties properties;
private static final String PROPERTIES = "/export.properties";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see my previous comment: #195 (comment)

@bpross-52n
Copy link
Member Author

Agreed, but I will need to fix the unit tests first...

@nuest
Copy link
Contributor

nuest commented Jun 25, 2014

One more thing: When downloading with FF, the extension/mime-type of the shapefile is .shp, not .zip.

unbenannt

@bpross-52n
Copy link
Member Author

I agree that this could be misleading, my only concern is that .zip could be too generic (whats in the zip file?). The API documentation clearly states that the shapefile is zipped. Changing the extension would cause changes on several locations (server/docs/website). Not a big problem, but lets be sure that this is really needed.

@matthesrieke
Copy link
Member

hehe. I once tried to load the .shp (the zip) into ArcMap and failed due to missing extraction :D maybe we can go for uuid.shp.zip? should be supported by all major OS.

@bpross-52n
Copy link
Member Author

Right, I tried that and it seemed as though the server only recognized the last suffix, i.e. .zip. Come to think of it, I will have to try it again, maybe it could work after all. But I'd suggest to handle it separated from this PR.

@nuest
Copy link
Contributor

nuest commented Jun 25, 2014

I second .shp.zip for the filename of the downloaded file (maybe that was not clear before?!), the final part of the URL should still be .shp.

@bpross-52n
Copy link
Member Author

I double checked an it is not directly possible to use uuid.shp.zip, because the URL path is split using dots to get the suffixes and if a if there is more than one suffix the other suffixes are concatenated to the path again, leading to uuid.zip. This is then used as track-id and of course no track is found.

Now, I could replace possible occurences of .zip in any track-id String before the the id is used for the database query. That way, we could use http://.../uuid.shp.zip and get a nice zip-file with the same name. Kind of a hack, I guess but this would give us the desired behavior... Any views?

@nuest
Copy link
Contributor

nuest commented Jun 25, 2014

I was actually thinking about just changing the name of the file using the Content-Disposition header, see http://stackoverflow.com/questions/5318132/is-it-possible-to-control-the-filename-for-a-response-from-a-jersey-rest-service

So something along the lines of

rb.header("Content-Disposition",  "attachment; filename=\"trackid.zip\"");

I think that was my first mistake, because you don't actually work on a specific service endpoint but just implement an encoder.

matthesrieke added a commit that referenced this pull request Jul 3, 2014
@matthesrieke matthesrieke merged commit 191d9a5 into enviroCar:dev Jul 3, 2014
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

Successfully merging this pull request may close these issues.

3 participants