Subscribe to this thread
Home - General / All posts - Manifold Commander: can't output .shp??
artlembo


3,404 post(s)
#21-Feb-24 17:24

Just fiddling around with manifoldcmd. Really useful. But, it does not appear that it can output .shp files.

Using this command, I am able to .gpkg, and .gdb:

manifoldcmd "County roads.map" -runquery:"buffers.txt" -out:"buffers.gpkg"

but, when I try and output a .shp I get "Invalid Component"

manifoldcmd "County roads.map" -runquery:"buffers.txt" -out:"buffers.shp"

I could not find in the documentation what the valid outputs are for -out:

oeaulong

522 post(s)
#21-Feb-24 17:47

Dbase constraints in field names and types? Does manually export fail?

artlembo


3,404 post(s)
#21-Feb-24 17:49

quick follow up. .shp does work as an export as follows:

' VBScript

Sub Main

 Set app = Manifold.Application

    Set db = app.GetDatabaseRoot()

 db.ExportFile "test Drawing""c:\projects\output\test.shp"

End Sub

so, I think it might have to do with the -out: in commander, given .gpkg works but not .shp.

Dimitri


7,420 post(s)
#22-Feb-24 10:48

Works fine for me using the example command line in theManifold Commander topic:

I confirmed the resulting shapefiles are exactly as expected.

Attachments:
cmd_export_shape.png

artlembo


3,404 post(s)
#22-Feb-24 15:03

thanks, Dimitri. I was able to export the .shp using the -export directive.

But, as I had indicated in my original post, when running a query, I was not able to get a .shp to output, but, I was able to get a .gpkg. So, something was off there.

To add to the confusion, I just ran this command:

c:\manifold9\manifoldcmd.exe "c:\temp\delgis\delgis examples.map" -export:"watersheds.geom" -out:"c:\temp\dennis\output\watersheds.shp"

that works fine. But, when I attempt to run this command:

c:\manifold9\manifoldcmd.exe "c:\temp\delgis\delgis examples.map" -export:"Buildings" -out:"c:\temp\dennis\output\buildings2.shp"

I get the "invalid component" error. I even get it with trying to export a .gpkg. So, there is something odd about that component, I think. It exports fine from inside the GUI.

Nonetheless, I was able to export a .shp by creating a script like this:

Sub Main

 Set app = Manifold.Application

 Set db = app.GetDatabaseRoot()

 text = db.GetProperty("Query""Text")

 db.Run(text)

 db.ExportFile "bmerge""c:\temp\output\brout.shp"

End Sub

in this case, I take the query that is working, and extract its text. Then I do a db.Run(text). When that completes, I run a db.ExportFile.

So, I still don't know why the -out: does not work for .shp when I've run it, but does work with the .ExportFile, the GUI, and a .gpkg.

Dimitri


7,420 post(s)
#23-Feb-24 04:35

That's a puzzle for sure. To solve it I think it would be necessary to drill into all details. For example, what is "Buildings"? Is it a drawing made from a query? A table? Could you publish the .map with the Buildings component?

artlembo


3,404 post(s)
#23-Feb-24 17:57

no need. you can try this yourself with Mexico. Run these two commands:

c:\manifold\manifoldcmd mexico.map -runquery:"query" -out:mex.gpkg

this works.

.

.

c:\manifold\manifoldcmd mexico.map -runquery:"query" -out:mex.shp

this throws "Invalid Component"

Dimitri


7,420 post(s)
#24-Feb-24 05:13

What's the query?

artlembo


3,404 post(s)
#24-Feb-24 13:11

The query component in this:

https://manifold.net/updates/Mexico_queries.mxb

I renamed the file Mexico.map

yves61
439 post(s)
#24-Feb-24 17:41

[deleted]

Manifold User Community Use Agreement Copyright (C) 2007-2021 Manifold Software Limited. All rights reserved.