I'm trying to do a simple post request to use the OGRE web app to convert JSON files to shapefiles.
I wrote this code, but the file doesn't download like it supposed to be, [edit] and it doesn't even upload the json.
The website specifies this as the input request params:
http://ogre.adc4gis.com/convertJson with one of the following params:
json - text of the GeoJSON file
jsonUrl - the URL for a remote GeoJSON file
outputName (optional) - the name for the resulting zip file
skipFailures (optional) - skip failures
What am I doing wrong ?
<html>
<head>
<script src="http://code.jquery.com/jquery-2.2.0.min.js" type="text/javascript"></script>
</head>
<body>
<input type="button" value="Send Post" onclick="sendPost()">
<script>
var data = { "type": "FeatureCollection",
"features": [{
"type": "Feature",
"geometry": { "type": "Point", "coordinates": [102.0, 0.5] },
"properties": { "prop0": "value0" }
}]
};
function sendPost() {
$.ajax({
type: "POST",
url: 'http://ogre.adc4gis.com/convertJson',
json: data,
success: success
});
}
function success(result) {
alert('Process achieved!');
}
</script>
</body>
</html>
I get this error:
Object {error: true, msg: "No json provided"}
What is the problem ?