This statement can take a long time to execute. On a file with 1.2 million MULTILINESTRINGS, it takes about 25 seconds. Instead of checking the dimension of every geometry in the table, I would vote for checking the dimension of just the first geometry:
```java
"SELECT ST_DIMENSION("+ geomFieldName + ") dim FROM " + location.toString()
```
In that case, the statement will take only a few milliseconds to execute. And this is the case we are in about 99.9% of the time.

On the other hand, if a column contains mixed geometries, some of them will probably not be displayed correctly. In this case, it will be up to the user to create a custom style. But this case is pretty rare.