Ich verwende OGR2OGR zum Konvertieren von Geojson-Datei in DXF-Format. Es funktioniert auf dem lokalen Server, aber auf dem Heroku-Server funktioniert es nicht. Suche Code, der für genrating Datei verwendet:Wie man den Systembefehl auf dem Heroku-Server ausführt?
str2 = {
"type":"FeatureCollection",
"features":[
{"type":"Feature","properties":{"color":"red"},"geometry":{"type":"Point","coordinates":[@substation]}},
{"type":"Feature","properties":{"color":"red"},"geometry":{"type":"Point","coordinates":[@feeder]}},
{"type":"Feature","properties":{"color":"red"},"geometry":{"type":"Point","coordinates":[@form3]}},
{"type":"Feature","properties":{"color":"red"},"geometry":{"type":"Point","coordinates":[@pdt_array]}},
{"type":"Feature","properties":{"color":"red"},"geometry":{"type":"Point","coordinates":[@edt_array]}},
{"type":"Feature","properties":{"color":"red"},"geometry":{"type":"Point","coordinates":[@composite_array]}},
{"type":"Feature","properties":{"color":"red"},"geometry":{"type":"Point","coordinates":[@al_array]}},
{"type":"Feature","properties":{"color":"red"},"geometry":{"type":"Point","coordinates":[@tp_array]}},
{"type":"Feature","properties":{"color":"red"},"geometry":{"type":"Point","coordinates":[@ot_array]}},
{"type":"Feature","properties":{"color":"red"},"geometry":{"type":"LineString","coordinates":[@lt_array,@ht_array,@consumer_array]}}
]}
path = "#{Rails.root}/public/data.geojson"
File.open(path, "w+") do |f|
f.write(JSON.pretty_generate(str2))
end
system("ogr2ogr -f DXF #{Rails.root}/public/delhiii.dxf #{Rails.root}/public/data.geojson")