|
"sarah" wrote in message <jpkhcb$q77$1@newscl01ah.mathworks.com>...
> I succeeded at using Matlab Builder JA. However, when I call Mapping toolbox functions such as shaperead from java, i get get errors like:
>
>
> ??? Error using ==> openShapeFiles>checkSHP at 75
> com.mathworks.toolbox.javabuilder.MWException: Error using ==> openShapeFiles>checkSHP at 75
> Failed to open both boston_roads.shp and boston_roads.SHP.
>
> Error in ==> openShapeFiles at 19
>
> Failed to open both boston_roads.shp and boston_roads.SHP.
>
>
> Error in ==> shaperead at 206
>
> Is there a way to solve this problem? Especially that other applications (not using the mapping toolbox or any other toolbox) work perfectly.
Which other functions have you tried? Do any of those functions open files, as does shaperead?
The error you received is issued if the MATLAB fopen function fails to open an SHP file; Mapping Toolbox is just checking the return value from fopen and reporting the problem.
Note that when you run shaperead from within MATLAB, you can ask it to open boston_roads.shp without providing any path information, because this SHP file is in a folder that is on the path by default. I'd be surprised if things work like this when calling shaperead or fopen from within Java. I'm not absolutely certain, but I'd expect that you'd have to provide at least a relative path, if not a fully qualified path. Try adding explicit path information, and see if that resolves your problem.
Rob Comer
Mapping Toolbox Development
MathWorks
|