Skip to main content
Solved

DWG to GeoJSON

  • July 25, 2024
  • 1 reply
  • 270 views

jp12212
Contributor
Forum|alt.badge.img+4

Hi,

 

Just was hoping for tips on Converting DWG to GeoJSON - is there any one who can lend an explanation I’m attempting the below and it’d be great if someone could offer a high level understanding / approach.

 

 

Best answer by donalmateer

Hi @jp12212,

Thank you for posting! 

Looking at the image attached I can understand some confusion you’re working through.
A quick explanation on why they workbench may not work.

The GeoJsonExtractor transformer is designed to extract GeoJSON data from attributes. It typically requires GeoJSON data to be already present in an attribute, but it appears to be connected directly to the output of the CoordinateSystemSetter, which usually handles geometries, not attributes. (JSONExtractor

The JSONFragmenter transformer is used to fragment JSON objects from an attribute. Similar to the GeoJsonExtractor, it expects JSON-formatted text in an attribute but is connected to the output of the GeoJsonExtractor, which should produce geometry.
 

The GeometryReplacer transformer is used to replace existing geometry with new geometry specified in an attribute. Since the JSONFragmenter is typically used for handling JSON data, this might not work as expected if the input to the GeometryReplacer is not in the correct format.

To properly convert DWG to GeoJSON, you should use the appropriate transformers for handling and writing geometric data directly to GeoJSON.

Reader (DWG) > CoordinateSystemSetter > GeoJSON Writer.

If you still have issues - do not hesitate to reach out again and we will help to find a solution. 

Thank you,
Donal. 

View original
Did this help you find an answer to your question?

1 reply

donalmateer
Safer
Forum|alt.badge.img+6
  • Safer
  • Best Answer
  • July 29, 2024

Hi @jp12212,

Thank you for posting! 

Looking at the image attached I can understand some confusion you’re working through.
A quick explanation on why they workbench may not work.

The GeoJsonExtractor transformer is designed to extract GeoJSON data from attributes. It typically requires GeoJSON data to be already present in an attribute, but it appears to be connected directly to the output of the CoordinateSystemSetter, which usually handles geometries, not attributes. (JSONExtractor

The JSONFragmenter transformer is used to fragment JSON objects from an attribute. Similar to the GeoJsonExtractor, it expects JSON-formatted text in an attribute but is connected to the output of the GeoJsonExtractor, which should produce geometry.
 

The GeometryReplacer transformer is used to replace existing geometry with new geometry specified in an attribute. Since the JSONFragmenter is typically used for handling JSON data, this might not work as expected if the input to the GeometryReplacer is not in the correct format.

To properly convert DWG to GeoJSON, you should use the appropriate transformers for handling and writing geometric data directly to GeoJSON.

Reader (DWG) > CoordinateSystemSetter > GeoJSON Writer.

If you still have issues - do not hesitate to reach out again and we will help to find a solution. 

Thank you,
Donal. 


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings