PDA

View Full Version : query output to shape file



Bart
April 5, 2016, 12:43 AM
hi,

I want to create a query to output a selection into a shapefile.
Is this possible in a query?

kind regards,

Bart

Patrick Moore
April 5, 2016, 07:35 AM
Bart,

Thank you for posting your question.

Yes it is possible and you have many different ways you can create them. InfoWater has two buttons that can switch the domain to a selection or switch a selection to the domain. This adds a great deal of flexibility in creating your query either in InfoWater or using ArcGIS. They are found near the domain manager icons and look like this:

(click for larger image if necessary)
229

With these two buttons one can either create a query in InfoWater using the domain manager or create a query in ArcGIS using the Selection-> Select by attributes to select items using ArcGIS to select items from one of the model layers. (Note: If you also combine all layer tables first, the model layers in the table of contents will include model attributes with the layers that can be used in an ArcGIS query as well. This is found in the InfoWater-> Utilities -> Database -> Join all layer tables.) The buttons allow you to create the query where it is most easiest (either InfoWater or ARCGIS) and then, if desired, switch the domain and selection or vice versa so you can export the data using InfoWater or ArcGIS.

One you have the data in the domain you can export the data in InfoWater as a shapefile using the InfoWater -> Exchange - Export manager (Make sure to choose to only export the domain) to export the domain of any of the model layers one at a time.

If desired you can also put the items you wish to export in the selection and export a shapefile using ArcGIS. (NOTE: this is best done only after joining the layer tables described above). To export, just right click on the layer to export and choose DATA -> Export data in the menu that pops up. One of the options is to export only selected features. I know many modelers over the years who like to use this method as it will include input data AND output data in the attributes, often asks if you want to add this as a data layer to the table of contents, and generally automatically includes the correct spatial projection. This often is desired and an advantage of using this method.

So using these two tools (switching domain to selection of back) along with the joining of all layer tables, gives the user much flexibility in creating a query and in exporting the data from the model. Use whichever method is the easiest to select the data you want and to export it using the method you want. The flexibility allows you to use whichever method at the time is the easiest and makes it very useful for the modeler as different situations often change which is the preferred method.

Please reply if you have any further questions on the methodology noted here.

Patrick Moore

Bart
April 6, 2016, 12:06 AM
Patrick,
Sorry, I was a bit unclear but I use InfoWorks 16.0.3.
In InfoWorks I don't have this Domain selection switch buttons?
Is it possible to export a selection to a shapefile with a query in InfoWorks?
Kind regards,
Bart

Patrick Moore
April 7, 2016, 07:13 AM
Bart,

Thanks for the clarification. Things would be different in InfoWorks than in InfoWater. Let me check with some of our staff who are more knowledgeable in InfoWorks on possibilities and I'll get back with you.

Patrick Moore

Patrick Moore
April 7, 2016, 12:33 PM
Bart,

Here is what was passed on to me from a couple of our staff who are more familiar with InfoWorks:

-> A query will not export a selection to a shape file. They need to make their selection using a query then use the Open Data Export Centre to export the selection to shapefile(s).

Here is what they recommend to do:


Make the selection and copy it into an empty network geoplan then export to shp.

Or


As noted above, export each layer using the ODEC with Selection Only checked .


It is not possible to export to shp using a query, queries only allow export to csv files using the INTO FILE “filename.csv” clause.


Please let us know if you have any further questions regarding this issue.

One tip you can also keep in mind when you have a specific InfoWorks WS question is to send your questions directly to the support@innovyze.com email box. As many of our support staff who are most familiar with InfoWorks are in the UK, sending an email to support@Innovyze.com (support@in) with questions on InfoWorks WS is often a way to get the fastest response from our entire support staff. Just another option for you if you need an answer quickly that is available to all users who are up to date on their software maintenance.

Thank You!

Patrick Moore