Parse 'NAN' values in WKT formats

This commit adds a hackish gsub! to string arguments passed to
parse_wkt methods in the factories. Some geometric objects can
develop 'NAN' values when adding a dimension and WKT parsing of
these value fails.